Commit 0ce05093 authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

Add children route TAPI

parent 0d7efda5
Loading
Loading
Loading
Loading
+5 −5
Changes for manifests/tapiservice.yaml: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -37,12 +37,12 @@ spec:
        
          imagePullPolicy: Always
          ports:
            - containerPort: 10070
            - containerPort: 9192
            - containerPort: 8008
          env:
            - name: LOG_LEVEL
              value: "INFO"
         
            - name: TAPISERVICE_SERVICE_BASEURL_HTTP
              value: "/tapi/"
          resources:
            requests:
              cpu: 50m
@@ -64,8 +64,8 @@ spec:
  ports:
    - name: grpc
      protocol: TCP
      port: 10070
      targetPort: 10070
      port: 8008
      targetPort: 8008
    - name: metrics
      protocol: TCP
      port: 9192
+1 −0
Changes for src/common/Constants.py: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ DEFAULT_SERVICE_GRPC_PORTS = {
DEFAULT_SERVICE_HTTP_PORTS = {
    ServiceNameEnum.NBI  .value : 8080,
    ServiceNameEnum.WEBUI.value : 8004,
    ServiceNameEnum.TAPI.value : 8008,
}

# Default HTTP/REST-API service base URLs
+2 −2
Changes for src/tapi/service/__main__.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ def main():
    start_http_server(metrics_port)

    host = get_setting('HOST', default=HOST)
    service_port = get_service_port_http(ServiceNameEnum.WEBUI)
    web_app_root = get_service_baseurl_http(ServiceNameEnum.WEBUI)
    service_port = get_service_port_http(ServiceNameEnum.TAPI)
    web_app_root = get_service_baseurl_http(ServiceNameEnum.TAPI)
    debug = get_setting('DEBUG', default=DEBUG)
    if isinstance(debug, str): debug = (debug.upper() in {'T', '1', 'TRUE'})
    
+6 −5
Changes for src/tapi/service/topology/routes.py: 6 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ from service.client.ServiceClient import ServiceClient
from slice.client.SliceClient import SliceClient


topology = Blueprint('topology', __name__)
topology = Blueprint('topology', __name__, url_prefix="/topology")


context_client = ContextClient()
@@ -61,7 +61,7 @@ def get_topology (context_uuid,topology_uuid) :
def create_topology (context_uuid) : 
    
    if context_uuid  :  
        topo_json = request.json()
        topo_json = request.json
        topo_uuid = topo_json.get('topology_uuid')
  
        try: 
@@ -79,16 +79,17 @@ def create_topology (context_uuid) :
@topology.route('/add_children', methods = ['POST'])
def add_children ()     :
    
    children= request.json()  
    children= request.json
    endpoints=[]
    child_topo = ChildTopology()
    for child in children :
    if children and 'topology' in children : 
        for child in children["topology"]:
            context_uuid = child.get('context_uuid',None)
            topo_uuid    = child.get('topology_uuid',None)
            host = child.get('host',None)
            port = child.get('port',None)
            
        url = ('{}/{}/tapi/get_topology/{}/{}').format(host,port,context_uuid,topo_uuid) 
            url = ('{}/8008/tapi/topology/get_topology/{}/{}').format(host,context_uuid,topo_uuid) 
            response = requests.get(url)
            if response.status_code == 200 : 
                logging.info(f"get_child_topo_details {response}")