- Forgot to git add clixon-clispec.yang
- Adjusted clixon to removal of deep reftree copying in CLIgen - Deleted old clixon yang versions
This commit is contained in:
parent
3c8c33c385
commit
87d243d7e5
6 changed files with 107 additions and 1290 deletions
|
|
@ -108,9 +108,6 @@ cli_handle_init(void)
|
|||
}
|
||||
cligen_userhandle_set(clih, cl);
|
||||
cligen_eval_wrap_fn_set(clih, plugin_context_check, cl);
|
||||
/* To minimize memory, dont copy full treerefs on expand */
|
||||
cligen_reftree_copy_set(clih, 0);
|
||||
|
||||
cl->cl_cligen = clih;
|
||||
|
||||
h = (clicon_handle)cl;
|
||||
|
|
|
|||
|
|
@ -796,8 +796,8 @@ cli_syntax_mode(clicon_handle h)
|
|||
* @param[in] h Clicon handle
|
||||
* @param[in] name Name of syntax mode
|
||||
* @param[in] prompt Prompt format
|
||||
* @retvak 0 OK
|
||||
* @retvak -1 Error
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
*/
|
||||
int
|
||||
cli_set_prompt(clicon_handle h,
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ CLIXON_EXAMPLE_REV="2020-12-01"
|
|||
# Problem with long keys are they take time to generate, eg on ARM
|
||||
CERTKEYLEN=2048
|
||||
|
||||
# CFLAGS for compile tests
|
||||
CFLAGS="@CFLAGS@"
|
||||
# Linking: static or dynamic
|
||||
LINKAGE=@LINKAGE@
|
||||
SH_SUFFIX=@SH_SUFFIX@
|
||||
|
|
|
|||
103
yang/clixon/clixon-clispec@2021-12-05.yang
Normal file
103
yang/clixon/clixon-clispec@2021-12-05.yang
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
module clixon-clispec{
|
||||
yang-version 1.1;
|
||||
namespace "http://clicon.org/clispec";
|
||||
prefix ccli;
|
||||
|
||||
organization
|
||||
"Clicon / Clixon";
|
||||
|
||||
contact
|
||||
"Olof Hagsand <olof@hagsand.se>";
|
||||
|
||||
description
|
||||
"Clixon CLIgen specification declarations, including autocli.
|
||||
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
Copyright (C) 2020-2021 Olof Hagsand and Rubicon Communications, LLC(Netgate)
|
||||
|
||||
This file is part of CLIXON
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the \"License\");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an \"AS IS\" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 3 or later (the \"GPL\"),
|
||||
in which case the provisions of the GPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of the GPL, and not to allow others to
|
||||
use your version of this file under the terms of Apache License version 2,
|
||||
indicate your decision by deleting the provisions above and replace them with
|
||||
the notice and other provisions required by the GPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the Apache License version 2 or the GPL.
|
||||
|
||||
***** END LICENSE BLOCK *****";
|
||||
|
||||
revision 2021-12-05 {
|
||||
description
|
||||
"Initial version";
|
||||
}
|
||||
|
||||
grouping clixon-clispec{
|
||||
list rule {
|
||||
key id;
|
||||
ordered-by user;
|
||||
description
|
||||
"Represents a modification rule of a clixon clispec.";
|
||||
leaf id {
|
||||
description
|
||||
"Arbitrary string index for the rule";
|
||||
type string;
|
||||
}
|
||||
leaf description {
|
||||
description
|
||||
"Rule description";
|
||||
type string;
|
||||
}
|
||||
leaf operation {
|
||||
type enumeration {
|
||||
enum hide {
|
||||
description
|
||||
"A complete command (not just single keyword) is hidden from CLI query,
|
||||
help and completion, ie a user must type it manually.
|
||||
Example: 'start shell'";
|
||||
}
|
||||
enum omit {
|
||||
description
|
||||
"Remove a single keyword from a command.
|
||||
Example: replace 'interfaces interface' with 'interface'";
|
||||
}
|
||||
}
|
||||
}
|
||||
leaf node-id {
|
||||
description
|
||||
"path in the form of <id>/<id> or just a single <id> identifying a YANG
|
||||
schema-node identifier as defined in RFC 7950 Sec 6.5
|
||||
Example: 'config', '/interfaces/interface'";
|
||||
mandatory true;
|
||||
type string;
|
||||
}
|
||||
leaf yang-statement {
|
||||
description
|
||||
"If present identifes a YANG statement which the rule applies to
|
||||
Example: 'container'";
|
||||
type string;
|
||||
}
|
||||
leaf module {
|
||||
description
|
||||
"If present constraints the rule to the module names identified by a glob.
|
||||
Wildchars '*' and '?' can be used.
|
||||
Revision and yang suffix are ommitted
|
||||
Example: 'openconfig-*'";
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,231 +0,0 @@
|
|||
module clixon-lib {
|
||||
yang-version 1.1;
|
||||
namespace "http://clicon.org/lib";
|
||||
prefix cl;
|
||||
|
||||
import ietf-yang-types {
|
||||
prefix yang;
|
||||
}
|
||||
organization
|
||||
"Clicon / Clixon";
|
||||
|
||||
contact
|
||||
"Olof Hagsand <olof@hagsand.se>";
|
||||
|
||||
description
|
||||
"Clixon Netconf extensions for communication between clients and backend.
|
||||
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
Copyright (C) 2009-2019 Olof Hagsand
|
||||
Copyright (C) 2020-2021 Olof Hagsand and Rubicon Communications, LLC(Netgate)
|
||||
|
||||
This file is part of CLIXON
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the \"License\");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an \"AS IS\" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 3 or later (the \"GPL\"),
|
||||
in which case the provisions of the GPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of the GPL, and not to allow others to
|
||||
use your version of this file under the terms of Apache License version 2,
|
||||
indicate your decision by deleting the provisions above and replace them with
|
||||
the notice and other provisions required by the GPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the Apache License version 2 or the GPL.
|
||||
|
||||
***** END LICENSE BLOCK *****";
|
||||
|
||||
revision 2021-03-08 {
|
||||
description
|
||||
"Changed: RPC process-control output to choice dependent on operation";
|
||||
}
|
||||
revision 2020-12-30 {
|
||||
description
|
||||
"Changed: RPC process-control output parameter status to pid";
|
||||
}
|
||||
revision 2020-12-08 {
|
||||
description
|
||||
"Added: autocli-op extension.
|
||||
rpc process-control for process/daemon management
|
||||
Released in clixon 4.9";
|
||||
}
|
||||
revision 2020-04-23 {
|
||||
description
|
||||
"Added: stats RPC for clixon XML and memory statistics.
|
||||
Added: restart-plugin RPC for restarting individual plugins without restarting backend.";
|
||||
}
|
||||
revision 2019-08-13 {
|
||||
description
|
||||
"No changes (reverted change)";
|
||||
}
|
||||
revision 2019-06-05 {
|
||||
description
|
||||
"ping rpc added for liveness";
|
||||
}
|
||||
revision 2019-01-02 {
|
||||
description
|
||||
"Released in Clixon 3.9";
|
||||
}
|
||||
typedef service-operation {
|
||||
type enumeration {
|
||||
enum start {
|
||||
description
|
||||
"Start if not already running";
|
||||
}
|
||||
enum stop {
|
||||
description
|
||||
"Stop if running";
|
||||
}
|
||||
enum restart {
|
||||
description
|
||||
"Stop if running, then start";
|
||||
}
|
||||
enum status {
|
||||
description
|
||||
"Check status";
|
||||
}
|
||||
}
|
||||
description
|
||||
"Common operations that can be performed on a service";
|
||||
}
|
||||
extension autocli-op {
|
||||
description
|
||||
"Takes an argument an operation defing how to modify the clispec at
|
||||
this point in the YANG tree for the automated generated CLI.
|
||||
Note that this extension is only used in clixon_cli.
|
||||
Operations is expected to be extended, but the following operations are defined:
|
||||
- hide This command is active but not shown by ? or TAB (meaning, it hides the auto-completion of commands)
|
||||
- hide-database This command hides the database
|
||||
- hide-database-auto-completion This command hides the database and the auto completion (meaning, this command acts as both commands above)";
|
||||
argument cliop;
|
||||
}
|
||||
rpc debug {
|
||||
description "Set debug level of backend.";
|
||||
input {
|
||||
leaf level {
|
||||
type uint32;
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc ping {
|
||||
description "Check aliveness of backend daemon.";
|
||||
}
|
||||
rpc stats {
|
||||
description "Clixon XML statistics.";
|
||||
output {
|
||||
container global{
|
||||
description "Clixon global statistics";
|
||||
leaf xmlnr{
|
||||
description "Number of XML objects: number of residing xml/json objects
|
||||
in the internal 'cxobj' representation.";
|
||||
type uint64;
|
||||
}
|
||||
}
|
||||
list datastore{
|
||||
description "Datastore statistics";
|
||||
key "name";
|
||||
leaf name{
|
||||
description "name of datastore (eg running).";
|
||||
type string;
|
||||
}
|
||||
leaf nr{
|
||||
description "Number of XML objects. That is number of residing xml/json objects
|
||||
in the internal 'cxobj' representation.";
|
||||
type uint64;
|
||||
}
|
||||
leaf size{
|
||||
description "Size in bytes of internal datastore cache of datastore tree.";
|
||||
type uint64;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
rpc restart-plugin {
|
||||
description "Restart specific backend plugins.";
|
||||
input {
|
||||
leaf-list plugin {
|
||||
description "Name of plugin to restart";
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rpc process-control {
|
||||
description
|
||||
"Control a specific process or daemon: start/stop, etc.
|
||||
This is for direct managing of a process by the backend.
|
||||
Alternatively one can manage a daemon via systemd, containerd, kubernetes, etc.";
|
||||
input {
|
||||
leaf name {
|
||||
description "Name of process";
|
||||
type string;
|
||||
mandatory true;
|
||||
}
|
||||
leaf operation {
|
||||
type service-operation;
|
||||
mandatory true;
|
||||
description
|
||||
"One of the strings 'start', 'stop', 'restart', or 'status'.";
|
||||
}
|
||||
}
|
||||
output {
|
||||
choice result {
|
||||
case status {
|
||||
description
|
||||
"Output from status rpc";
|
||||
leaf active {
|
||||
description
|
||||
"True if process is running, false if not.
|
||||
More specifically, there is a process-id and it exists (in Linux: kill(pid,0).
|
||||
Note that this is actual state and status is administrative state,
|
||||
which means that changing the administrative state, eg stopped->running
|
||||
may not immediately switch active to true.";
|
||||
type boolean;
|
||||
}
|
||||
leaf description {
|
||||
type string;
|
||||
description "Description of process. This is a static string";
|
||||
}
|
||||
leaf command {
|
||||
type string;
|
||||
description "Start command with arguments";
|
||||
}
|
||||
leaf status {
|
||||
description
|
||||
"Administrative status (except on external kill where it enters stopped
|
||||
directly from running):
|
||||
stopped: pid=0, No process running
|
||||
running: pid set, Process started and believed to be running
|
||||
exiting: pid set, Process is killed by parent but not waited for";
|
||||
type string;
|
||||
}
|
||||
leaf starttime {
|
||||
description "Time of starting process UTC";
|
||||
type yang:date-and-time;
|
||||
}
|
||||
leaf pid {
|
||||
description "Process-id of main running process (if active)";
|
||||
type uint32;
|
||||
}
|
||||
}
|
||||
case other {
|
||||
description
|
||||
"Output from start/stop/restart rpc";
|
||||
leaf ok {
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue