summaryrefslogtreecommitdiff
path: root/yang-modules
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-09-22 17:53:18 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-09-22 17:53:18 -0500
commit83c1e1451d2cfac34cae4e4d7a9eb30a134436d0 (patch)
treefc6511d9af0f6bd49d3388ef07ea82f8c866e8b5 /yang-modules
parent7cbc505de4f06896617c24fcf54855b8790ac75e (diff)
downloadnetconfapk-83c1e1451d2cfac34cae4e4d7a9eb30a134436d0.tar.gz
netconfapk-83c1e1451d2cfac34cae4e4d7a9eb30a134436d0.tar.bz2
netconfapk-83c1e1451d2cfac34cae4e4d7a9eb30a134436d0.tar.xz
netconfapk-83c1e1451d2cfac34cae4e4d7a9eb30a134436d0.zip
doc: Add initial YANG model for service mgmt
Diffstat (limited to 'yang-modules')
-rw-r--r--yang-modules/adelie-services.yang131
1 files changed, 131 insertions, 0 deletions
diff --git a/yang-modules/adelie-services.yang b/yang-modules/adelie-services.yang
new file mode 100644
index 0000000..60761d3
--- /dev/null
+++ b/yang-modules/adelie-services.yang
@@ -0,0 +1,131 @@
+module adelie-services {
+ yang-version 1.1;
+ namespace 'https://netconf.adelielinux.org/ns/services';
+ prefix svcs;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization "Adélie Software in the Public Benefit, Inc.";
+ contact
+ " Adélie Software in the Public Benefit, Inc.
+
+ Postal: Adélie Software
+ P.O. Box 701386
+ Tulsa, OK 74170
+ United States
+
+ Email: <mailto:netconf&lists.adelielinux.org>";
+
+ description
+ "This module contains a collection of YANG definitions for
+ managing network services on a device containing a NETCONF
+ server. This includes protocol operations for starting and
+ stopping services.
+
+ Copyright (c) 2020 Adélie Software and the persons identified
+ as authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the NCSA License set forth
+ in the LICENSE file contained in the NETCONF APK repository
+ (https://code.foxkit.us/adelie/netconfapk/blob/current/LICENSE).
+
+ This version of this YANG module is part of the NETCONF APK
+ 1.0 distribution; see the distributon for full legal notices.";
+
+ revision 2020-09-22 {
+ description
+ "Initial revision.";
+ reference
+ "Service Management Requirements for NETCONF APK
+ (https://da.gd/ncservice)";
+ }
+
+ typedef service-status {
+ type enumeration {
+ enum stopped {
+ description
+ "The service is not presently running.";
+ }
+ enum starting {
+ description
+ "The service is in the process of starting.";
+ }
+ enum running {
+ description
+ "The service is presently running.";
+ }
+ enum stopping {
+ description
+ "The service is in the process of stopping.";
+ }
+ enum crashed {
+ description
+ "The service was running, but stopped unexpectedly.";
+ }
+ }
+ description
+ "The status of a service.";
+ }
+
+ container services {
+ description
+ "Service configuration.";
+
+ list service {
+ key "name";
+
+ description
+ "The list of services on the device.";
+
+ leaf name {
+ type string;
+ description
+ "The name of the service.
+
+ Changing the name of the service may have surprising
+ consequences. It is not recommended.";
+ }
+
+ leaf description {
+ type string;
+ config false;
+ description
+ "A textual description of the service.
+
+ Depending on the service manager in use on the device,
+ this node may be empty or contain only the name of the
+ service.";
+ }
+
+ leaf enabled {
+ type boolean;
+ mandatory true;
+ description
+ "This leaf contains the desired state of the service.
+
+ When this leaf is true, the service will be started
+ automatically by the device during system bootup.";
+ }
+
+ leaf status {
+ type service-status;
+ config false;
+ mandatory true;
+ description
+ "The current status of the service.";
+ }
+
+ leaf start-time {
+ type yang:date-and-time;
+ config false;
+ when "./status = 'running'";
+ description
+ "The time that this service entered the running state.";
+ }
+ }
+ }
+}