projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wait.py: updated POLLING_TIME_INTERVAL to 5s for --wait option
[osm/osmclient.git]
/
osmclient
/
sol005
/
vnf.py
diff --git
a/osmclient/sol005/vnf.py
b/osmclient/sol005/vnf.py
index
11d2057
..
6da13f5
100644
(file)
--- a/
osmclient/sol005/vnf.py
+++ b/
osmclient/sol005/vnf.py
@@
-33,15
+33,20
@@
class Vnf(object):
self._apiBase = '{}{}{}'.format(self._apiName,
self._apiVersion, self._apiResource)
self._apiBase = '{}{}{}'.format(self._apiName,
self._apiVersion, self._apiResource)
- def list(self, ns=None):
+ def list(self, ns=None
, filter=None
):
"""Returns a list of VNF instances
"""
filter_string = ''
"""Returns a list of VNF instances
"""
filter_string = ''
+ if filter:
+ filter_string = '?{}'.format(filter)
if ns:
ns_instance = self._client.ns.get(ns)
if ns:
ns_instance = self._client.ns.get(ns)
- filter_string = '?nsr-id-ref={}'.format(ns_instance['_id'])
+ if filter_string:
+ filter_string += ',nsr-id-ref={}'.format(ns_instance['_id'])
+ else:
+ filter_string = '?nsr-id-ref={}'.format(ns_instance['_id'])
resp = self._http.get_cmd('{}{}'.format(self._apiBase,filter_string))
resp = self._http.get_cmd('{}{}'.format(self._apiBase,filter_string))
- #print
'RESP: {}'.format(resp
)
+ #print
('RESP: {}'.format(resp)
)
if resp:
return resp
return list()
if resp:
return resp
return list()
@@
-67,7
+72,7
@@
class Vnf(object):
vnf_id = vnf['_id']
break
resp = self._http.get_cmd('{}/{}'.format(self._apiBase, vnf_id))
vnf_id = vnf['_id']
break
resp = self._http.get_cmd('{}/{}'.format(self._apiBase, vnf_id))
- #print
'RESP: {}'.format(resp
)
+ #print
('RESP: {}'.format(resp)
)
if resp:
return resp
raise NotFound("vnf {} not found".format(name))
if resp:
return resp
raise NotFound("vnf {} not found".format(name))