Constraints on fields
With constraints on fields you can hide and/or suggest reasonable defaults for all provisioning options. This helps you simplify the machine provisioning process for your end users.
Please keep in mind that only members of the Owners team can manage constraints. Also, constraints are available only in Mist Hosted Service (HS) and Mist Enterprise Edition (EE).
Example
Below is Mist's default create machine web form for DigitalOcean. As you will notice, you need to provide several details. Some are optional and some are required. The required fields are noted with an asterisk (*).
Let's assume that you would like to:
- Hide all optional fields to simplify provisioning.
- Allow only the use of an Ubuntu 21.04 x86 image.
- Hide the image field since there will be no other options available.
To set this up, from the Teams section:
- Make sure you belong to the Owners team.
- Click on the Dev team.
- Click the gear icon next to the team policy that applies to machines.
- Fill out the relevant cloud and field options as shown below.
- Don't forget to click OK and then SAVE POLICY for the changes to take effect.
If you prefer to input your policy in JSON, you can switch to JSON mode from the top right of the web form.
In this example, the JSON equivalent would be:
{ "field": [ { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "image", "value": "81bab001d1604be3b2230bc327badf62" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "cloud_init", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "addvolume", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "expiration", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "post_provision_script", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "post_provision_scheduler", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "hostname", "value": "" }, { "cloud": "94fcfb3878214479909f8f0ba5e769ee", "show": false, "name": "monitoring", "value": "" } ] }
Please note that for the default value of the image field you will need to find the relevant ID from the images section. These IDs are unique per Mist organization.
After you complete the steps above, members of the dev team will view the create machine form below: