netgroup-polito / frog4-datastore

Datastore for the FROG4 project. It contains VNF images and templates, network functions forwarding graphs, and more
2 stars 0 forks source link

Now NF Template ID is assigned by the datastore + refactoring v2 APIs #5

Closed MadLuigi closed 7 years ago

MadLuigi commented 7 years ago

I've created an expanded addVNFTemplate method for V2 APIs. This method generates the NF ID (6 alphanumeric chars string, unique in datastore) and provides it into the body reply to the caller. So now there are two URLs for putting templates. One is for creating a new NF (without vnf_id parameter in the url) and one to update existing NFs (vnf_id parameter required). I've also modded the VNF model adding the boolean field "image_upload_complete". This field is meant to filter out NF templates which have uncompleted or in progress image upload from get requests. Now when the command to delete uncompleted image uploads run it also deletes the related template from datastore's DB.