Open uakfdotb opened 8 years ago
Here is one possibility:
User can define configurable options:
CREATE TABLE options (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(64) NOT NULL,
helptext VARCHAR(256) NOT NULL,
order_id INT NOT NULL,
metadata_key VARCHAR(64) NOT NULL
);
CREATE TABLE option_values (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
option_id INT NOT NULL,
description VARCHAR(256) NOT NULL,
metadata_value VARCHAR(256) NOT NULL,
price BIGINT NOT NULL DEFAULT 0
);
User can associate regions with options (via another table; note that it is regions and not plans since the VM creation page includes both plans and these options, although we could load it via JS if we wanted to). Client can set options, which will be passed as part of the plan metadata to the VM interface.
VMs also need to be associated with options so that the user can be charged the correct amount, in case price is non-zero.
This looks looks like a good approach, as an admin I would bind options to regions, and endusers would have the ability to enable/disable them when creating vms?
The assoisiation is key with billing is key.
Yeah. Probably the options will be able to be arbitrary, but if the only two options are yes/no then it will show a checkbox instead of a select dropdown. Should probably support text field options too somehow. Still need to think about it some more.
See #66 and #71.
It should be possible to set up plans so that plan metadata is set according to user-submitted preferences, which can be collected from the VM creation page. Ideally, each preference can be associated with an additional hourly charge.
This proposal needs more details.