The "Add VS" https://docs.onapp.com/display/32API/Add+VS is quite needlessly complicated.
In a REST API, the idea is to have simple objects that can have references to each other.
However, in "Add VS", you are asked for all kinds of information that has nothing to do with a vm. For example, primary disk info, swap disk info, network info, etc.
This has a couple of implications:
- It's not possible to create servers without disks. This is particularly annoying when doing automated API work (which most API work is, after all)
- It means the already existing interface to create disks and nics are now sort-of cloned into a huge list of parameters, which is harder to read, review and use.
I have a suggestion for a backwards-compatible fix:
Let all primary_disk* and swap_disk* information be optional. If not specified, the server will be created without disks, which can then afterwards be added through the API (or manually, for that matter). This is 100% compatible with the current API.
This is halfways supported, since a "swap_size" of 0 skips the swap space construction. But primary_disk_size must be at least 5.
What do you think?
Please sign in to leave a comment.