8.1. Chef JSON Key Value Description

The following provides the key value pairs that must be contained in the JSON file supporting Chef action.

8.1.1. Table A1. Chef JSON File key value description

Field Name Description Type Comment
Environment A JSON dictionary representing a Chef Environment object. If the VNF action requires loading or modifying Chef environment attributes associated with the VNF, all the relevant information must be provided in this JSON dictionary in a structure that conforms to a Chef Environment Object. Optional Depends on VNF action.

A JSON dictionary representing a Chef Node Object.

The Node JSON dictionary must include the run list to be triggered for the desired VNF action by the push job. It should also include any attributes that need to be configured on the Node Object as part of the VNF action.

NodeList Array of FQDNs that correspond to the endpoints (VMs) of a VNF registered with the Chef Server that need to trigger a chef-client run as part of the desired VNF action. Mandatory  
PushJobFlag This field indicates whether the VNF action requires a push Job. Push job object will be created by ONAP if required. Mandatory If set to “True”, ONAP will request a push job. Ignored otherwise.
CallbackCapable This field indicates if the chef-client run invoked by push job corresponding to the VNF action is capable of posting results on a callback URL. Optional If Chef cookbook is callback capable, VNF owner is required to set it to “True”. Ignored otherwise.
GetOutputFlag Flag which indicates whether ONAP should retrieve output generated in a chef-client run from Node object attribute node[‘PushJobOutput’] for this VNF action (e.g., in Audit). Mandatory ONAP will retrieve output from NodeObject attributes [‘PushJobOutput’] for all nodes in NodeList if set to “True”. Ignored otherwise.

Chef Template example:

     "name": "HAR",
     "description": "VNF Chef environment for HAR",
     "json_class": "Chef::Environment",
     "chef_type": "environment",
     "default_attributes": { },
     "override_attributes": {
           "MemCache": "1024",
"Node": {
     "name" : "signal.network.com "
     "chef_type": "node",
     "json_class": "Chef::Node",
     "attributes": {
           "IPAddress1": "",
     "override": {},
     "default": {},
     "chef_environment" : "_default"
     "run_list": [ "configure_signal" ]
     "NodeList":["node1.vnf_a.onap.com", "node2.vnf_a.onap.com"],
     "PushJobFlag": "True"
     "GetOutputFlag" : "False"

The example JSON file provided by the VNF provider for each VNF action will be turned into a template by ONAP, that can be updated with instance specific values at run-time.

Some points worth noting regarding the JSON fields:

  1. The JSON file must be created for each action for each VNF.
  2. If a VNF action involves multiple endpoints (VMs) of a VNF, ONAP will replicate the “Node” JSON dictionary in the template and post it to each FQDN (i.e., endpoint) in the NodeList after setting the “name” field in the Node object to be the respective FQDN [1]. Hence, it is required that all end points (VMs) of a VNF involved in a VNF action support the same set of Node Object attributes.

The following table describes the JSON dictionary to post in Callback.

8.1.2. Table A2. JSON Dictionary to Post in Callback

Key Description Type Comment
RequestId A unique string associated with the original request by ONAP. This key-value pair will be provided by ONAP in the environment of the push job request and must be returned as part of the POST message. Mandatory  
StatusCode An integer that must be set to 200 if chef-client run on the node finished successfully 500 otherwise. Mandatory  

A string which must be set to ‘SUCCESS’ if StatusCode was 200

Appropriate error message otherwise.

Name A string which corresponds to the name of the node where push job is run. It is required that the value be retrieved from the node object attributes (where it is always defined). Mandatory  
PushJobOutput Any output from the chef-client run that needs to be returned to ONAP. Optional Depends on VNF action. If empty, it must not be included.
[1]The “name” field is a mandatory field in a valid Chef Node Object JSON dictionary.