Skip to content
Snippets Groups Projects
Commit acf8c193 authored by Carlos Manso's avatar Carlos Manso
Browse files

Merge branch...

Merge branch 'feat/147-integrate-support-for-ip-e2e-optical-sdn-controllers-to-manage-hierarchical-virtual' of https://labs.etsi.org/rep/tfs/controller into feat/147-integrate-support-for-ip-e2e-optical-sdn-controllers-to-manage-hierarchical-virtual
parents 1359da7a 0303c9a3
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!225Resolve "Integrate Support for IP-E2E-Optical SDN controllers to manage hierarchical virtual topologies"
......@@ -104,22 +104,22 @@ spec:
limits:
cpu: 2000m
memory: 2048Mi
# ---
# apiVersion: autoscaling/v2
# kind: HorizontalPodAutoscaler
# metadata:
# name: ztpservice-hpa
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: ztpservice
# minReplicas: 1
# maxReplicas: 10
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# type: Utilization
# averageUtilization: 80
# ---
# apiVersion: autoscaling/v2
# kind: HorizontalPodAutoscaler
# metadata:
# name: ztpservice-hpa
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: ztpservice
# minReplicas: 1
# maxReplicas: 10
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# type: Utilization
# averageUtilization: 80
......@@ -238,4 +238,4 @@ class E2EOrchestratorServiceServicerImpl(E2EOrchestratorServiceServicer):
path.connections.append(conn)
return path
......@@ -82,13 +82,6 @@ def main():
rest_server.start()
register_context_subscription()
LOGGER.debug('Configured Resources:')
for resource in rest_server.api.resources:
LOGGER.debug(' - {:s}'.format(str(resource)))
LOGGER.debug('Configured Rules:')
for rule in rest_server.app.url_map.iter_rules():
LOGGER.debug(' - {:s}'.format(str(rule)))
LOGGER.debug('Configured Resources:')
for resource in rest_server.api.resources:
......
......@@ -13,18 +13,17 @@
# limitations under the License.
import json
import logging
from flask.json import jsonify
from flask_restful import Resource, request
from werkzeug.exceptions import BadRequest
from common.proto.context_pb2 import Empty
from common.proto.context_pb2 import Empty, LinkTypeEnum
from common.tools.grpc.Tools import grpc_message_to_json
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient
from service.client.ServiceClient import ServiceClient
from slice.client.SliceClient import SliceClient
from vnt_manager.client.VNTManagerClient import VNTManagerClient
import logging
from common.proto.context_pb2 import LinkTypeEnum
from .Tools import (
format_grpc_to_json, grpc_connection_id, grpc_context, grpc_context_id, grpc_device,
......@@ -297,7 +296,7 @@ class Links(_Resource):
class Link(_Resource):
def get(self, link_uuid : str):
return format_grpc_to_json(self.context_client.GetLink(grpc_link_id(link_uuid)))
return format_grpc_to_json(self.context_client.GetLink(grpc_link_id(link_uuid)))
def put(self, link_uuid : str):
link_json = request.get_json()
......
......@@ -23,7 +23,7 @@ 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.Device import json_device_id
from common.tools.object_factory.Link import json_link_id, json_link
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.Slice import json_slice_id
......
......@@ -19,7 +19,6 @@ from .Resources import (
Device, DeviceIds, Devices,
DummyContexts,
Link, LinkIds, Links,
VirtualLink, VirtualLinkIds, VirtualLinks,
PolicyRule, PolicyRuleIds, PolicyRules,
Service, ServiceIds, Services,
Slice, SliceIds, Slices,
......@@ -31,38 +30,38 @@ URL_PREFIX = '/tfs-api'
# 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.context_ids', ContextIds, '/context_ids'),
('api.contexts', Contexts, '/contexts'),
('api.dummy_contexts', DummyContexts, '/dummy_contexts'),
('api.context', Context, '/context/<path:context_uuid>'),
('api.context_ids', ContextIds, '/context_ids'),
('api.contexts', Contexts, '/contexts'),
('api.dummy_contexts', DummyContexts, '/dummy_contexts'),
('api.context', Context, '/context/<path:context_uuid>'),
('api.topology_ids', TopologyIds, '/context/<path:context_uuid>/topology_ids'),
('api.topologies', Topologies, '/context/<path:context_uuid>/topologies'),
('api.topology', Topology, '/context/<path:context_uuid>/topology/<path:topology_uuid>'),
('api.topology_ids', TopologyIds, '/context/<path:context_uuid>/topology_ids'),
('api.topologies', Topologies, '/context/<path:context_uuid>/topologies'),
('api.topology', Topology, '/context/<path:context_uuid>/topology/<path:topology_uuid>'),
('api.service_ids', ServiceIds, '/context/<path:context_uuid>/service_ids'),
('api.services', Services, '/context/<path:context_uuid>/services'),
('api.service', Service, '/context/<path:context_uuid>/service/<path:service_uuid>'),
('api.service_ids', ServiceIds, '/context/<path:context_uuid>/service_ids'),
('api.services', Services, '/context/<path:context_uuid>/services'),
('api.service', Service, '/context/<path:context_uuid>/service/<path:service_uuid>'),
('api.slice_ids', SliceIds, '/context/<path:context_uuid>/slice_ids'),
('api.slices', Slices, '/context/<path:context_uuid>/slices'),
('api.slice', Slice, '/context/<path:context_uuid>/slice/<path:slice_uuid>'),
('api.slice_ids', SliceIds, '/context/<path:context_uuid>/slice_ids'),
('api.slices', Slices, '/context/<path:context_uuid>/slices'),
('api.slice', Slice, '/context/<path:context_uuid>/slice/<path:slice_uuid>'),
('api.device_ids', DeviceIds, '/device_ids'),
('api.devices', Devices, '/devices'),
('api.device', Device, '/device/<path:device_uuid>'),
('api.device_ids', DeviceIds, '/device_ids'),
('api.devices', Devices, '/devices'),
('api.device', Device, '/device/<path:device_uuid>'),
('api.link_ids', LinkIds, '/link_ids'),
('api.links', Links, '/links'),
('api.link', Link, '/link/<path:link_uuid>'),
('api.link_ids', LinkIds, '/link_ids'),
('api.links', Links, '/links'),
('api.link', Link, '/link/<path:link_uuid>'),
('api.connection_ids', ConnectionIds, '/context/<path:context_uuid>/service/<path:service_uuid>/connection_ids'),
('api.connections', Connections, '/context/<path:context_uuid>/service/<path:service_uuid>/connections'),
('api.connection', Connection, '/connection/<path:connection_uuid>'),
('api.connection_ids', ConnectionIds, '/context/<path:context_uuid>/service/<path:service_uuid>/connection_ids'),
('api.connections', Connections, '/context/<path:context_uuid>/service/<path:service_uuid>/connections'),
('api.connection', Connection, '/connection/<path:connection_uuid>'),
('api.policyrule_ids', PolicyRuleIds, '/policyrule_ids'),
('api.policyrules', PolicyRules, '/policyrules'),
('api.policyrule', PolicyRule, '/policyrule/<path:policyrule_uuid>'),
('api.policyrule_ids', PolicyRuleIds, '/policyrule_ids'),
('api.policyrules', PolicyRules, '/policyrules'),
('api.policyrule', PolicyRule, '/policyrule/<path:policyrule_uuid>'),
]
def register_tfs_api(rest_server : RestServer):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment