Skip to content

Schemas

MiguelRivasQuobis edited this page Apr 30, 2019 · 13 revisions

Schemas

Every descriptor must follow a particular schema. All of the schemas can be found here. If new types are included, they will be included in that folder.

The schemas works as base of the descriptors, they restrict the fields which the descriptor must contain. The library jsonschema is used to validate the correct form of the descriptors.

  • Note: Although the descriptors are in YAML format, it is possible to validate them with jsonschema because JSON is a subset of YAML.
jsonschema.validate(descriptor, schema)

Currently, the validator supports the following types.

  • Virtual Network Function Descriptors (VNFD).
  • Network Service Descriptors (NSD).
  • Tests descriptors (TSTD).

The schemas are saved locally in the folder ~/.tng-shema/. Every time the tng-sdk-validate tool is invoked, the schemas will be download again but, if it is invoked offline, the validator will use the local schemas.

# Example with connectivity
Replacing schema file '/home/quobis/.tng-schema/service-descriptor/nsd-schema.yml'
Replacing schema file '/home/quobis/.tng-schema/function-descriptor/vnfd-schema.yml'
Replacing schema file '/home/quobis/.tng-schema/test-descriptor/test-schema.yml'

#Example without connectivity
There has had a problem in the connection and is not possible reload the schema. It will be used the stored schema in /home/quobis/.tng-schema/service-descriptor/nsd-schema.yml
There has had a problem in the connection and is not possible reload the schema. It will be used the stored schema in /home/quobis/.tng-schema/function-descriptor/vnfd-schema.yml
There has had a problem in the connection and is not possible reload the schema. It will be used the stored schema in /home/quobis/.tng-schema/test-descriptor/test-schema.yml

Clone this wiki locally