Scheduled maintenance on Saturday, 27 September 2025, from 07:00 AM to 4:00 PM GMT (09:00 AM to 6:00 PM CEST) - some services may be unavailable -

Skip to content
Snippets Groups Projects
Select Git revision
  • 192573a4e33c3d97da452a53897a2ef90123f6f2
  • master default
  • feat/320-cttc-ietf-simap-basic-support-with-kafka-yang-push
  • cnit_tapi
  • feat/292-cttc-implement-integration-test-for-ryu-openflow
  • feat/314-tid-new-service-for-ipowdm-configuration-fron-orchestrator-to-ipowdm-controller
  • feat/327-tid-new-service-to-ipowdm-controller-to-manage-transceivers-configuration-on-external-agent
  • cnit-p2mp-premerge
  • feat/325-tid-nbi-e2e-to-manage-e2e-path-computation
  • feat/307-update-python-version-service
  • feat/326-tid-external-management-of-devices-telemetry-nbi
  • openroadm-flex-grid
  • feat/310-cttc-implement-nbi-connector-to-interface-with-osm-client
  • develop protected
  • feat/324-tid-nbi-ietf_l3vpn-deploy-fail
  • feat/321-add-support-for-gnmi-configuration-via-proto
  • feat/322-add-read-support-for-ipinfusion-devices-via-netconf
  • feat/323-add-support-for-restconf-protocol-in-devices
  • feat/policy-refactor
  • feat/192-cttc-implement-telemetry-backend-collector-gnmi-openconfig
  • feat/307-update-python-version
  • feat/telemetry-collector-int
  • v5.0.0 protected
  • v4.0.0 protected
  • demo-dpiab-eucnc2024
  • v3.0.0 protected
  • v2.1.0 protected
  • v2.0.0 protected
  • v1.0.0 protected
29 results

messages_emulated.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    configure_dashboards_in_kubernetes.sh 3.35 KiB
    #!/bin/bash
    # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    
    # If not already set, set the name of the Kubernetes namespace and hostname to deploy to.
    K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'}
    K8S_HOSTNAME=${K8S_HOSTNAME:-'kubernetes-master'}
    
    INFLUXDB_USER=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode)
    INFLUXDB_PASSWORD=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode)
    INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode)
    
    # GRAFANA_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}')
    # GRAFANA_HOSTNAME=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'`
    GRAFANA_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master -o jsonpath='{$.items[*].status.addresses[?(@.type=="InternalIP")].address}'`
    GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}')
    #GRAFANA_PORT=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].nodePort}'`
    GRAFANA_USERNAME="admin"
    GRAFANA_PASSWORD=${GRAFANA_PASSWORD:-"admin123+"}
    GRAFANA_URL="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}"
    echo "Connecting to grafana at URL: ${GRAFANA_URL}..."
    
    # Configure Grafana Admin Password
    # Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password
    curl -X PUT -H "Content-Type: application/json" -d '{
      "oldPassword": "admin",
      "newPassword": "'${GRAFANA_PASSWORD}'",
      "confirmNew" : "'${GRAFANA_PASSWORD}'"
    }' http://admin:admin@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}/api/user/password
    echo
    
    # Create InfluxDB DataSource
    # Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/
    curl -X POST -H "Content-Type: application/json" -d '{
      "type"     : "influxdb",
      "name"     : "InfluxDB",
      "url"      : "http://monitoringservice:8086",
      "access"   : "proxy",
      "basicAuth": false,
      "user"     : "'"$INFLUXDB_USER"'",
      "password" : "'"$INFLUXDB_PASSWORD"'",
      "isDefault": true,
      "database" : "'"$INFLUXDB_DATABASE"'"
    }' ${GRAFANA_URL}/api/datasources
    echo
    
    # Create Monitoring Dashboard
    # Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/
    curl -X POST -H "Content-Type: application/json" \
      -d '@src/webui/grafana_dashboard.json' \
      ${GRAFANA_URL}/api/dashboards/db
    echo
    
    DASHBOARD_URL="${GRAFANA_URL}/api/dashboards/uid/tf-l3-monit"
    DASHBOARD_ID=$(python -c 'import json, requests; print(requests.get("'${DASHBOARD_URL}'").json()["dashboard"]["id"])')
    curl -X POST ${GRAFANA_URL}/api/user/stars/dashboard/${DASHBOARD_ID}