Skip to content

Commit

Permalink
add config_db entries for TELEMETRY|gnmi|save_on_set (#19309)
Browse files Browse the repository at this point in the history
* add config_db entries for TELEMETRY|gnmi|save_on_set

* add save_on_set to sonic-gnmi.yang
  • Loading branch information
rlucus authored Jul 25, 2024
1 parent d9e6ab7 commit 08f333b
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,8 @@ and is listed in this table.
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051"
"port": "50051",
"save_on_set": "false"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/gnmi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"desc": "TABLE_WITH_INCORRECT_PORT failure.",
"eStrKey": "InvalidValue"
},
"GNMI_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"desc": "TABLE_WITH_INCORRECT_SAVE_ON_SET failure",
"eStrKey": "InvalidValue"
},
"GNMI_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"desc": "TABLE_WITH_INCORRECT_PORT failure.",
"eStrKey": "InvalidValue"
},
"TELEMETRY_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"desc": "TABLE_WITH_INCORRECT_SAVE_ON_SET failure",
"eStrKey": "InvalidValue"
},
"TELEMETRY_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
}
}
},
"GNMI_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"sonic-gnmi:sonic-gnmi": {
"sonic-gnmi:GNMI": {
"certs": {
"ca_crt": "/etc/sonic/credentials/dsmsroot.cer",
"server_crt": "/etc/sonic/credentials/server.cer",
"server_key": "/etc/sonic/credentials/server.key"
},
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051",
"save_on_set": "wrong"
}
}
}
},
"GNMI_TABLE_WITH_VALID_CONFIG": {
"sonic-gnmi:sonic-gnmi": {
"sonic-gnmi:GNMI": {
Expand All @@ -58,7 +75,8 @@
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50052"
"port": "50052",
"save_on_set": "false"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
}
}
},
"TELEMETRY_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"sonic-telemetry:sonic-telemetry": {
"sonic-telemetry:TELEMETRY": {
"certs": {
"ca_crt": "/etc/sonic/telemetry/dsmsroot.cer",
"server_crt": "/etc/sonic/telemetry/streamingtelemetryserver.cer",
"server_key": "/etc/sonic/telemetry/streamingtelemetryserver.key"
},
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051",
"save_on_set": "wrong"
}
}
}
},
"TELEMETRY_TABLE_WITH_VALID_CONFIG": {
"sonic-telemetry:sonic-telemetry": {
"sonic-telemetry:TELEMETRY": {
Expand All @@ -58,7 +75,8 @@
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051"
"port": "50051",
"save_on_set": "false"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-gnmi.yang
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ module sonic-gnmi {
description "Port gnmi runs on.";
}

leaf save_on_set {
type boolean;
description "Flag for enabling save on set.";
}

}

}
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-telemetry.yang
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ module sonic-telemetry {
description "Port gnmi runs on.";
}

leaf save_on_set {
type boolean;
description "Flag for enabling save on set.";
}

}

}
Expand Down

0 comments on commit 08f333b

Please sign in to comment.