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

Merge branch 'feat/246-cttc-implement-methods-to-retrieve-topologydetails-in-nbi' into 'develop'

Resolve "(CTTC) Implement methods to retrieve TopologyDetails in NBI"

See merge request !316
parents f8fb28f6 8029e324
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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)))
+27 −26
Original line number Diff line number Diff line
@@ -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'
@@ -38,6 +38,7 @@ RESOURCES = [
    ('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'),