我正在验证用户在热模板中传递的味道。目前,热模板允许我在允许值中提到口味的名称。下面是一小段代码,
parameters:
flavor_type:
type: string
label: Flavor type
description: Type of instance (flavor) to be used
constraints:
- allowed_values: [m1.xlarge ]
description: Value must be one of m1.xlarge.当用户传递名为m1.xlarge而不是其他名称的味道时,这是有效的。
我想允许特定大小的自定义口味(RAM - 8、HD - 150、VCPU -8)。我想要在热模板中验证这些单独的值,以验证传递的味道。
我觉得这是一个检查风格的有效用例。热模板中有没有可能出现这种情况?
谢谢,Rama Krishna
发布于 2017-11-22 03:54:13
热规范具有自定义约束的概念。在https://docs.openstack.org/heat/pike/template_guide/hot_spec.html上搜索“自定义约束”。您可以利用它来验证输入是否为使用该模板的用户可用的风格之一
flavor_type:
type: string
label: Flavor type
description: Type of instance (flavor) to be used
constraints:
- custom_constraint: nova.flavorhttps://stackoverflow.com/questions/47158135
复制相似问题