VOSS and Fabric Engine support JSON format to represent the data resource. The following information describes the JSON representation for the YANG elements:
The YANG elements in the resource models are mapped to JSON elements for the proper serialization.
A leaf element is mapped into a single key-value pair. The key and the value are separated by a colon.
A container element is mapped into a JSON object. Thus, the equivalent representation of a container starts with a left curly bracket and ends with a right curly bracket. The elements within the container are separated a comma.
A list element is mapped into a JSON array. Thus, the equivalent representation of the list starts with a left square bracket and ends with a right square bracket. The instances of the list element are separated by a comma.
The following is an example of JSON representation.
{
"openconfig-system:authentication":{
"admin-user":{
"config":{
"admin-password": "********",
"admin-password-encrypted": null },
"state": {
"admin-password": "********",
"admin-password-encrypted": null },
"admin-username": "rwa"
}
},
"config":{
"authentication-method": [
"LOCAL“ ]
},
"state": {
"authentication-method": [
"LOCAL“ ]
},
"users": { "user": [{"config": {
"password": "********",
"password-encrypted": null,
"role": "read-write-all",
"ssh-key": null,
"username": "user1"},
"state": {"password": "********",
"password-encrypted": null,
"role": "read-write-all",
"ssh-key": null,
"username": "user1“},
"username": "user1"},{
"config": {"password": "********",
"password-encrypted": null,
"role": "read-only",
"ssh-key": null,
"username": "ro"},
"state": {"password": "********",
"password-encrypted": null,
"role": "read-only",
"ssh-key": null,
"username": "ro"},
"username": "ro"}, {
"config": {"password": "********",
"password-encrypted": null,
"role": "read-write",
"ssh-key": null,
"username": "rw"},
"state": {
"password": "********",
"password-encrypted": null,
"role": "read-write",
"ssh-key": null,
"username": "rw"},
"username": "rw"}, {
"config": {
"password": "********",
"password-encrypted": null,
"role": "SYSTEM_ROLE_ADMIN",
"ssh-key": null,
"username": "rwa"},
"state": {
"password": "********",
"password-encrypted": null,
"role": "SYSTEM_ROLE_ADMIN",
"ssh-key": null,
"username": "rwa"},
"username": "rwa"}]}
}
}