Skip to content

Custom rules validation user cases

MiguelRivasQuobis edited this page Jun 21, 2019 · 12 revisions

Introduction

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

Rules

vdu_resource_requirements_ram_size

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!

vdu_resource_requisrements_ram_size_unit

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!

vdu_resource_requirements_cpu_vcpus

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!

vdu_resource_requirements_storage_size

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!

vdu_resource_requirements_storage_size_unit

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!

vdu_resource_requirements_network_network_interface_bandwidth

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!

vdu_resource_requirements_network_network_interface_bandwidth_unit

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!

vdu_vm_resource_format

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!