X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fvim.py;h=ec1ccaddeb466d6a004848154938004dffc42264;hb=refs%2Fchanges%2F57%2F6157%2F1;hp=8aee4539529e2ba4c1db03519be4880976cec648;hpb=93b9862dd5092327dab103ce44cf27bb89606b69;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/vim.py b/osmclient/sol005/vim.py index 8aee453..ec1ccad 100644 --- a/osmclient/sol005/vim.py +++ b/osmclient/sol005/vim.py @@ -90,11 +90,17 @@ class Vim(object): return vim['uuid'] raise NotFound("vim {} not found".format(name)) - def delete(self, vim_name): + def delete(self, vim_name, force=False): vim_id = vim_name if not utils.validate_uuid4(vim_name): vim_id = self.get_id(vim_name) - http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,vim_id)) + querystring = '' + if force: + querystring = '?FORCE=True' + http_code, resp = self._http.delete_cmd('{}/{}{}'.format(self._apiBase, + vim_id, querystring)) + if resp: + resp = json.loads(resp) #print 'RESP: {}'.format(resp) if http_code == 202: print 'Deletion in progress'