From 65819b8fa4aaa53250a255fc1c06fb3a8638aa12 Mon Sep 17 00:00:00 2001 From: stevenvanrossem Date: Fri, 5 Aug 2016 18:21:47 +0200 Subject: [PATCH] fix get compute list via rest api, without datacenter specified --- src/emuvim/api/rest/compute.py | 4 ++-- src/emuvim/api/rest/network.py | 1 + src/emuvim/api/rest/rest_api_endpoint.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emuvim/api/rest/compute.py b/src/emuvim/api/rest/compute.py index 9f0516b..1082a4d 100755 --- a/src/emuvim/api/rest/compute.py +++ b/src/emuvim/api/rest/compute.py @@ -106,10 +106,10 @@ class ComputeList(Resource): global dcs - def get(self, dc_label): + def get(self, dc_label=None): logging.debug("API CALL: compute list") try: - if dc_label == 'None': + if dc_label is None: # return list with all compute nodes in all DCs all_containers = [] for dc in dcs.itervalues(): diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py index e3945b0..83fbde7 100755 --- a/src/emuvim/api/rest/network.py +++ b/src/emuvim/api/rest/network.py @@ -53,6 +53,7 @@ class NetworkAction(Resource): :param match: OpenFlow match format of the flow entry :param bidirectional: boolean value if the link needs to be implemented from src to dst and back :param cookie: cookie value, identifier of the flow entry to be installed. + :param priority: integer indicating the priority of the flow entry :return: message string indicating if the chain action is succesful or not """ diff --git a/src/emuvim/api/rest/rest_api_endpoint.py b/src/emuvim/api/rest/rest_api_endpoint.py index 536ed7a..51b58cb 100755 --- a/src/emuvim/api/rest/rest_api_endpoint.py +++ b/src/emuvim/api/rest/rest_api_endpoint.py @@ -62,7 +62,9 @@ class RestApiEndpoint(object): self.api = Api(self.app) # setup endpoints - self.api.add_resource(ComputeList, "/restapi/compute/") + self.api.add_resource(ComputeList, + "/restapi/compute", + "/restapi/compute/") self.api.add_resource(ComputeStart, "/restapi/compute///start") self.api.add_resource(ComputeStop, "/restapi/compute///stop") self.api.add_resource(ComputeStatus, "/restapi/compute//") -- 2.25.1