Skip to content
Snippets Groups Projects
Commit 473348d3 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into...

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into feat/245-cttc-define-fields-to-specify-type-of-link
parents c16d84f3 aed5f50e
No related branches found
No related tags found
1 merge request!315Resolve "(CTTC) Define fields to specify type of link"
......@@ -177,6 +177,11 @@ class Topology(_Resource):
def delete(self, context_uuid : str, topology_uuid : str):
return format_grpc_to_json(self.context_client.RemoveTopology(grpc_topology_id(context_uuid, topology_uuid)))
class TopologyDetails(_Resource):
def get(self, context_uuid : str, topology_uuid : str):
topology_id = grpc_topology_id(context_uuid, topology_uuid)
return format_grpc_to_json(self.context_client.GetTopologyDetails(topology_id))
class ServiceIds(_Resource):
def get(self, context_uuid : str):
return format_grpc_to_json(self.context_client.ListServiceIds(grpc_context_id(context_uuid)))
......
......@@ -22,7 +22,7 @@ from .Resources import (
PolicyRule, PolicyRuleIds, PolicyRules,
Service, ServiceIds, Services,
Slice, SliceIds, Slices,
Topologies, Topology, TopologyIds
Topologies, Topology, TopologyDetails, TopologyIds
)
URL_PREFIX = '/tfs-api'
......@@ -30,38 +30,39 @@ 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.topology_details', TopologyDetails, '/context/<path:context_uuid>/topology_details/<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