-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better support non-string parameter types including comma-delimited-list, number, boolean https://bugzilla.redhat.com/show_bug.cgi?id=1489908
- Loading branch information
Showing
6 changed files
with
243 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 113 additions & 1 deletion
114
spec/fixtures/orchestration_templates/heat_parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,113 @@ | ||
{"heat_template_version":"2013-05-23","description":"Incomplete sample template for testing parsing of various parameters","parameter_groups":[{"label":"General parameters","description":"General parameters","parameters":["flavor","image_id","cartridges"]},{"parameters":["admin_pass","db_port","metadata"]}],"parameters":{"admin_pass":{"type":"string","description":"Admin password","hidden":true,"constraints":[{"length":{"min":6,"max":8},"description":"Admin password must be between 6 and 8 characters long.\n"},{"allowed_pattern":"[a-zA-Z0-9]+","description":"Password must consist of characters and numbers only"},{"allowed_pattern":"[A-Z]+[a-zA-Z0-9]*","description":"Password must start with an uppercase character"}]},"flavor":{"type":"string","description":"Flavor for the instances to be created","default":"m1.small","constraints":[{"custom_constraint":"nova.flavor","description":"Must be a flavor known to Nova"}]},"cartridges":{"description":"Cartridges to install. \"all\" for all cartridges; \"standard\" for all cartridges except for JBossEWS or JBossEAP\n","type":"string","default":"cron,diy,haproxy,mysql,nodejs,perl,php,postgresql,python,ruby"},"db_port":{"type":"number","label":"Port Number","description":"Database port number","default":50000,"constraints":[{"range":{"min":40000,"max":60000},"description":"Port number must be between 40000 and 60000"}]},"image_id":{"type":"string","description":"ID of the image to use for the instance to be created.","default":"F18-x86_64-cfntools","constraints":[{"allowed_values":["F18-i386-cfntools","F18-x86_64-cfntools"],"description":"Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools."}]},"metadata":{"type":"json"}}} | ||
{ | ||
"heat_template_version": "2013-05-23", | ||
"description": "Incomplete sample template for testing parsing of various parameters", | ||
"parameter_groups": [ | ||
{ | ||
"label": "General parameters", | ||
"description": "General parameters", | ||
"parameters": [ | ||
"flavor", | ||
"image_id", | ||
"cartridges" | ||
] | ||
}, | ||
{ | ||
"parameters": [ | ||
"admin_pass", | ||
"db_port", | ||
"metadata", | ||
"skip_failed" | ||
] | ||
} | ||
], | ||
"parameters": { | ||
"admin_pass": { | ||
"type": "string", | ||
"description": "Admin password", | ||
"hidden": true, | ||
"constraints": [ | ||
{ | ||
"length": { | ||
"min": 6, | ||
"max": 8 | ||
}, | ||
"description": "Admin password must be between 6 and 8 characters long.\n" | ||
}, | ||
{ | ||
"allowed_pattern": "[a-zA-Z0-9]+", | ||
"description": "Password must consist of characters and numbers only" | ||
}, | ||
{ | ||
"allowed_pattern": "[A-Z]+[a-zA-Z0-9]*", | ||
"description": "Password must start with an uppercase character" | ||
} | ||
] | ||
}, | ||
"flavor": { | ||
"type": "string", | ||
"description": "Flavor for the instances to be created", | ||
"default": "m1.small", | ||
"constraints": [ | ||
{ | ||
"custom_constraint": "nova.flavor", | ||
"description": "Must be a flavor known to Nova" | ||
} | ||
] | ||
}, | ||
"cartridges": { | ||
"description": "Cartridges to install. \"all\" for all cartridges; \"standard\" for all cartridges except for JBossEWS or JBossEAP\n", | ||
"type": "comma_delimited_list", | ||
"default": [ | ||
"cron", | ||
"diy", | ||
"haproxy", | ||
"mysql", | ||
"nodejs", | ||
"perl", | ||
"php", | ||
"postgresql", | ||
"python", | ||
"ruby" | ||
] | ||
}, | ||
"db_port": { | ||
"type": "number", | ||
"label": "Port Number", | ||
"description": "Database port number", | ||
"default": 50000, | ||
"constraints": [ | ||
{ | ||
"range": { | ||
"min": 40000, | ||
"max": 60000 | ||
}, | ||
"description": "Port number must be between 40000 and 60000" | ||
} | ||
] | ||
}, | ||
"image_id": { | ||
"type": "string", | ||
"description": "ID of the image to use for the instance to be created.", | ||
"default": "F18-x86_64-cfntools", | ||
"constraints": [ | ||
{ | ||
"allowed_values": [ | ||
"F18-i386-cfntools", | ||
"F18-x86_64-cfntools" | ||
], | ||
"description": "Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools." | ||
} | ||
] | ||
}, | ||
"metadata": { | ||
"type": "json", | ||
"default": { | ||
"ver": "test" | ||
} | ||
}, | ||
"skip_failed": { | ||
"type": "boolean", | ||
"default": "t" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters