Skip to content

Local mode

danifernandezcalv edited this page Jul 26, 2018 · 1 revision

Local mode

When running in local mode, automatic monitoring and validation of objects may be set up in the workspace configuration, under the 'validate_watchers' key (workspace.yml file). This key should included all the files that the user wants them to be observed. Example of workspace config with 3 files in watchers mode, one function with syntax validation, one functions with syntax and integrity validations and one function with all validations (in this case we need to specify the path of the file with the custom rules):

validate_watchers:
  /home/dani/.tng-workspace/projects/test/vnfd.yml:
    integrity: false
    syntax: true
    topology: false
    custom: false
    type: function
  /home/dani/.tng-workspace/projects/test2/vnfd.yml:
    integrity: true
    syntax: true
    topology: false
    custom: false
    type: function
  /home/dani/.tng-workspace/projects/test3/vnfd.yml:
    integrity: true
    syntax: true
    topology: true
    custom: true
    cfile: /home/dani/.tng-workspace/projects/test3/custom_rule_1.yml
    type: function

For run the API in local mode we need to specify the path of the workspace. Example:

tng-sdk-validate --api --mode local --workspace /path_of_workspace

When one of the files watched change, the API will validate this new changes and save in the cache the results of it.

Clone this wiki locally