Commit c016f5e2 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Hackfest:

- updated TAPI exercise
parent 26a7a467
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -4,22 +4,22 @@
      "uuid" : "cs1",
      "service-type":"POINT_TO_POINT_CONNECTIVITY",
      "connectivity-constraint": {
        "requested-capacity": {"total-size": { "value": "1", "unit": "GBPS" }},
        "connectivity-direction": "BIDIRECTIONAL"
        "requested-capacity": {"total-size": { "value": "50", "unit": "GHz" }},
        "connectivity-direction": "UNIDIRECTIONAL"
      },
      "end-point": [
        {
          "local-id": "csep-1",
          "layer-protocol-name": "ETH",
          "layer-protocol-name": "PHOTONIC_MEDIA",
          "service-interface-point": {
            "service-interface-point-uuid": "sip-pe1-uni1"
            "service-interface-point-uuid": "node-1-port-13-input"
          }
        },
        {
          "local-id":"csep-2",
          "layer-protocol-name":"ETH",
          "layer-protocol-name":"PHOTONIC_MEDIA",
          "service-interface-point": {
            "service-interface-point-uuid": "sip-pe2-uni1"
            "service-interface-point-uuid": "node-2-port-14-output"
          }
        } 
      ]
+15 −8
Original line number Diff line number Diff line
@@ -20,16 +20,19 @@ cd ~/tfs-ctrl/hackfest/tapi/server
python3 -m tapi_server

RUN TAPI CLIENT (In a new window):
# Context:
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/service-interface-point=sip-pe1-uni1/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/node=node-odu-pi-4/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/node=node-odu-pi-4/owned-node-edge-point=nep-pi4-odu4-nni1/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/node=node-odu-pi-4/owned-node-edge-point=nep-pi4-odu4-nni1/tapi-connectivity:cep-list/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/link=link-pe1-odu4-nni1-pi4-odu4-nni2/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/service-interface-point=node-4-port-16-output/

# Topology:
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/owned-node-edge-point=node-4-port-13/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/owned-node-edge-point=node-4-port-13/tapi-connectivity:cep-list/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/link=link-4:2-2:4/

# Connection:
curl -X POST -H "Content-Type: application/json" \
    http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service/ \
    -d @/home/tfs/tfs-ctrl/hackfest/tapi/client/cs1.json
@@ -41,5 +44,9 @@ curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/d
curl -X DELETE -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service=cs1/


# Exercise: retrieve and draw the topology
solution in folder tapi_app


Not testable since there is no path computation 
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=topo-nwk/node=node-odu-pi-4/owned-node-edge-point=nep-pi4-odu4-nni1/tapi-connectivity:cep-list/connection-end-point={cep-uuid}/
curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-odu-pi-4/owned-node-edge-point=node-4-port-13/tapi-connectivity:cep-list/connection-end-point={cep-uuid}/
+1 −1
Original line number Diff line number Diff line
#!/bin/bash

python3 -m tapi_server 8080 database/odu_context.json
python3 -m tapi_server 8080 database/mini-ols-context.json
+11 −7
Original line number Diff line number Diff line
@@ -408,11 +408,9 @@ def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_s
        uuid=body.connectivity_service.uuid,
        connection_end_point=[
            TapiConnectivityConnectionEndPointRef(
                node_edge_point_uuid="NEP_PE_01_NNI3", connection_end_point_uuid="cep11"),
                node_edge_point_uuid="node-1-port-3", connection_end_point_uuid="cep13"),
            TapiConnectivityConnectionEndPointRef(
                node_edge_point_uuid="NEP_PE_03_NNI2", connection_end_point_uuid="cep11"),
            TapiConnectivityConnectionEndPointRef(
                node_edge_point_uuid="NEP_PE_02_NNI3", connection_end_point_uuid="cep11"),
                node_edge_point_uuid="node-3-port-2", connection_end_point_uuid="cep32"),
        ]
    )
    connection_ref = TapiConnectivityConnectionRef(connection.uuid)
@@ -582,10 +580,16 @@ def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_s
        database.context.connectivity_context = TapiConnectivityConnectivityContext(
            connectivity_service=[], connection=[]
        )

    database.context.connectivity_context.connectivity_service = [
        cs
        for cs in database.context.connectivity_context.connectivity_service
        if cs.uuid != uuid # keep items with different uuid
        connectivity_service
        for connectivity_service in database.context.connectivity_context.connectivity_service
        if connectivity_service.uuid != uuid # keep items with different uuid
    ]
    database.context.connectivity_context.connection = [
        connection
        for connection in database.context.connectivity_context.connection
        if connection.uuid != uuid # keep items with different uuid
    ]


+728 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading