-
Notifications
You must be signed in to change notification settings - Fork 6
Custom rules validation user cases
The custom rules validation allows the user to test serveral options in his own vnfd descriptors. To perform the validation it is necessary to include a YAML document with the rules which will be applied. More information about the rule engine.
The following sections contain the supported rules with examples explaining the way to use that rules in the YAML file.
*Note
The name of the rule is related with the position of the field in the vnfd schema
Check the RAM memory assigned to VDUs (field in schema).
# Example
- conditions:
all:
- name: vdu_resource_requirements_ram_size
operator: less_than_or_equal_to
value: 4
actions:
- name: raise_error
params:
error_text: The size of RAM must be higher than 4GB!
Check the unit of RAM memory assigned to VDUs (field in schema).
# Example
- conditions:
all:
- name: vdu_resource_requirements_ram_size_unit
operator: equal_to
value: "GB"
actions:
- name: raise_error
params:
error_text: The unit of RAM must be equal to GB!
Check the number of CPUs availables in every VDU. (field in schema).
- conditions:
all:
- name: vdu_resource_requirements_cpu_vcpus
operator: less_than
value: 2
actions:
- name: raise_error
params:
error_text: The number of CPUs must be higher than 2!
Check the amount of storage in VDUs (field in schema)
# Example
- conditions:
all:
- name: vdu_resource_requirements_storage_size
operator: less_than_or_equal_to
value: 4
actions:
- name: raise_error
params:
error_text: The size of storage must be higher than 4!
Check the unit of storage (field in schema)
# Example
- conditions:
all:
- name: vdu_resource_requirements_storage_size_unit
operator: equal_to
value: GB
actions:
- name: raise_error
params:
error_text: The unit of storage must be MB!
Check the number the amount of bandwidth needed (field in schema)
# Example
- conditions:
all:
- name: vdu_resource_requirements_network_network_interface_bandwidth
operator: less_than_or_equal_to
value: 4
actions:
- name: raise_error
params:
error_text: The bandwidth must be higher than 4!
Check the unit of bandwidth (field in schema)
# Example
- conditions:
all:
- name: vdu_resource_requirements_network_network_interface_bandwidth_unit
operator: equal_to
value: bps
actions:
- name: raise_error
params:
error_text: The unit of bandwidth must be kbps!
Check the format of virtualization used (field in schema)
# Example
- conditions:
all:
- name: vdu_vm_resource_format
operator: equal_to
value: "qcow2"
actions:
- name: raise_error
params:
error_text: The vm format must be docker!