From 83c1e1451d2cfac34cae4e4d7a9eb30a134436d0 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 22 Sep 2020 17:53:18 -0500 Subject: doc: Add initial YANG model for service mgmt --- yang-modules/adelie-services.yang | 131 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 yang-modules/adelie-services.yang (limited to 'yang-modules') 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: "; + + 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."; + } + } + } +} -- cgit v1.2.3-60-g2f50