X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fopenstack%2Fopenstack_dummies%2Fnova_dummy_api.py;h=514755edd4efd63a751cc184a521dbb370b7c48f;hp=f294617db91637f643e1f44af3ba4fc77debd337;hb=9e975accc9959605fe980f1f5a5bb4996f5746c0;hpb=4e37abbc1a06ffa40ed11c7c6a16c1fe95403161 diff --git a/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py b/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py index f294617..514755e 100755 --- a/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py +++ b/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py @@ -226,6 +226,8 @@ class NovaListServersApi(Resource): server = self.api.compute.create_server(name) server.full_name = str(self.api.compute.dc.label) + "_man_" + server_dict["name"] server.template_name = server_dict["name"] + if "metadata" in server_dict: + server.properties = server_dict["metadata"] for flavor in self.api.compute.flavors.values(): if flavor.id == server_dict.get('flavorRef', ''): @@ -520,6 +522,14 @@ class NovaListFlavorById(Resource): LOG.exception(u"%s: Could not retrieve flavor with id %s" % (__name__, flavorid)) return ex.message, 500 + def delete(self, id, flavorid): + """ + Removes the given flavor. + Does not really remove anything from the machine, just fakes an OK. + """ + LOG.debug("API CALL: %s GET" % str(self.__class__.__name__)) + return Response("{}", status=204, mimetype="application/json") + class NovaListImages(Resource): def __init__(self, api): @@ -634,6 +644,14 @@ class NovaListImageById(Resource): LOG.exception(u"%s: Could not retrieve image with id %s." % (__name__, imageid)) return ex.message, 500 + def delete(self, id, imageid): + """ + Removes the given image. + Does not really remove anything from the machine, just fakes an OK. + """ + LOG.debug("API CALL: %s GET" % str(self.__class__.__name__)) + return Response("{}", status=204, mimetype="application/json") + class NovaShowServerDetails(Resource): def __init__(self, api):