* New clixon-lib@2020-12-08.yang revision
* Added: autocli-op extension (see new features) * Added: rpc process-control for process/daemon management * Added enable flag and removed presence in clixon-restconf
This commit is contained in:
parent
d6db28c47a
commit
8540820698
11 changed files with 135 additions and 102 deletions
|
|
@ -44,6 +44,7 @@ module clixon-lib {
|
|||
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 {
|
||||
|
|
@ -63,6 +64,28 @@ module clixon-lib {
|
|||
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
|
||||
|
|
@ -123,4 +146,34 @@ module clixon-lib {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
rpc process-control {
|
||||
description
|
||||
"Control a specific process or daemon: start/stop, etc.
|
||||
This is for direct managing of a porcess 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'.";
|
||||
}
|
||||
leaf namespace {
|
||||
type string;
|
||||
description
|
||||
"Network namespace.";
|
||||
}
|
||||
}
|
||||
output {
|
||||
leaf status {
|
||||
type boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,35 +57,27 @@ module clixon-restconf {
|
|||
description
|
||||
"PAM password auth";
|
||||
}
|
||||
enum none {
|
||||
description
|
||||
"No authentication, no security.";
|
||||
}
|
||||
}
|
||||
description
|
||||
"Enumeration of HTTP authorization types.";
|
||||
}
|
||||
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";
|
||||
}
|
||||
grouping clixon-restconf{
|
||||
description
|
||||
"HTTP daemon configuration.";
|
||||
"HTTP RESTCONF configuration.";
|
||||
leaf enable {
|
||||
type boolean;
|
||||
default "false";
|
||||
description
|
||||
"Enables RESTCONF functionality.
|
||||
Note that starting/stopping of a restconf daemon is different from it being
|
||||
enabled or not.
|
||||
For example, if the restconf daemon is under systemd management, the restconf
|
||||
daemon will only start if enable=true.";
|
||||
}
|
||||
leaf-list auth-type {
|
||||
type http-auth-type;
|
||||
description
|
||||
|
|
@ -135,42 +127,4 @@ module clixon-restconf {
|
|||
presence "Enables RESTCONF";
|
||||
uses clixon-restconf;
|
||||
}
|
||||
rpc restconf-control {
|
||||
input {
|
||||
leaf operation {
|
||||
type service-operation;
|
||||
mandatory true;
|
||||
description
|
||||
"One of the strings 'start', 'stop', 'restart', or 'status'.";
|
||||
}
|
||||
leaf namespace {
|
||||
type string;
|
||||
description
|
||||
"Network namespace.";
|
||||
}
|
||||
}
|
||||
output {
|
||||
leaf stdout {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc restconf-coredump {
|
||||
input {
|
||||
leaf operation {
|
||||
type boolean;
|
||||
mandatory true;
|
||||
}
|
||||
leaf namespace {
|
||||
type string;
|
||||
description
|
||||
"Network namespace.";
|
||||
}
|
||||
}
|
||||
output {
|
||||
leaf stdout {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue