X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fvnf.py;h=6da13f563f0e0d2ee895ccc22f5e00d957f5d697;hb=refs%2Fchanges%2F19%2F8119%2F1;hp=11d205726a90c7893e46a739718fce72815ea444;hpb=cf95eefc01755e1f18459ffd921ebcfe4fba5cc1;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/vnf.py b/osmclient/sol005/vnf.py index 11d2057..6da13f5 100644 --- 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) - def list(self, ns=None): + def list(self, ns=None, filter=None): """Returns a list of VNF instances """ filter_string = '' + if filter: + filter_string = '?{}'.format(filter) 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)) - #print 'RESP: {}'.format(resp) + #print('RESP: {}'.format(resp)) 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)) - #print 'RESP: {}'.format(resp) + #print('RESP: {}'.format(resp)) if resp: return resp raise NotFound("vnf {} not found".format(name))