module yumaworks-system { namespace "http://yumaworks.com/ns/yumaworks-system"; prefix "ysys"; import ietf-netconf { prefix nc; } import ietf-netconf-monitoring { prefix ncm; } import ietf-yang-types { prefix yang; } import yuma-app-common { prefix yumaapp; } import yuma-ncx { prefix ncx; } import yuma-types { prefix nt; } import yumaworks-restconf { prefix rc; } //import yuma-system { prefix yuma-sys; } import ietf-netconf-acm { prefix nacm; } organization "YumaWorks, Inc."; contact "Support "; description "Common system operations for the netconfd-pro server. Copyright (c) 2013 - 2017 YumaWorks, Inc. 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 BSD 3-Clause License http://opensource.org/licenses/BSD-3-Clause"; revision 2017-12-22 { description "Copy load rpc into this module so yuma-system can be removed."; } revision 2017-10-06 { description "Add save-config parameter to the load and load-bundle operations. Add delete-config parameter to the unload and unload-bundle operations."; } revision 2016-08-24 { description "Add unload-bundle operation."; } revision 2016-04-27 { description "Add deviation parameter to load-bundle input params."; } revision 2015-09-26 { description "Add depth parameter to get, get-config, and copy-config operations."; } revision 2014-10-16 { description "Add with-owners parameter to get, get-config, and copy-config operations."; } revision 2014-05-27 { description "Add overwrite parameter to backup operation."; } revision 2014-01-09 { description "Add load-bundle operation."; } revision 2013-11-13 { description "Add replay-config internal operation. Add module-type leaf to netconf-state schema list"; } revision 2013-09-19 { description "Add comment parameter to commit operation."; } revision 2013-08-30 { description "Add unload operation."; } revision 2013-07-16 { description "Add cancel-subscription operation."; } revision 2013-01-06 { description "Initial version."; } augment /ncm:netconf-state { container backup-files { config false; description "Reports the backup files currently available on the server. Only present if backup commands in this module are supported by the server"; list backup-file { key name; leaf name { type nt:NcxName; description "File name for the backup."; } leaf backup-time { type yang:date-and-time; description "Date and time the backup file was created."; } } } } augment /ncm:netconf-state/ncm:schemas/ncm:schema { leaf conformance { type boolean; config false; description "Indicates whether the server is claiming conformance to the module represented by this schema or not. If 'true', the server implements the module represented by the indicated schema, according to the YANG module capability URI. If 'false', the server just imports definitions from the module represented by the indicated schema."; } leaf module-type { type enumeration { enum module { description "Schema represents a YANG module"; } enum submodule { description "Schema represents a YANG submodule"; } } config false; description "Indicates the type of module for this entry"; } } rpc backup { nacm:default-deny-all; description "Backup the current running configuration to a file on the device."; input { ncx:default-parm filename; leaf filename { type nt:NcxName; mandatory true; description "File name for the backup. A simple identifier name is expected with no directory specifications or file extensions added. (e.g., 'backup1')."; } leaf overwrite { type boolean; default false; description "If 'true' then allow an existing backup with the same 'filename' value to be overwritten. If 'false' then return an error if the file already exists."; } } } rpc delete-backup { nacm:default-deny-all; description "Delete the specified backup file on the device."; input { ncx:default-parm filename; leaf filename { type nt:NcxName; mandatory true; description "File name to delete"; } } } rpc restore { nacm:default-deny-all; description "Restore a saved configuration on the device to the running configuration."; input { ncx:default-parm filename; leaf filename { type nt:NcxName; mandatory true; description "File name for the restore. A simple identifier name is expected with no directory specifications or file extensions added. (e.g., 'backup1')."; } } } rpc cancel-subscription { description "Cancel a notification subscription for the session, if this session has an active subscription. If not, just return OK."; } rpc unload { nacm:default-deny-all; description "Unload a module from the server. Remove the associated server instrumentation library (SIL). Remove any data nodes in the system from the module. Remove the module from the server capabilities and NETCONF monitoring data. Remove the module namespace from the system. Note: this operation does not remove the --module parameter from the server configuration file if it exists. The following conditions must be true for the unload to be attempted by the server: * The module is allowed to be unloaded. It is data-model and vendor specific whether a module can be removed at run-time. * There are no dependencies on the module being removed. No modules that import this module are also loaded. * The module was loaded into the server, either via the operation or the --module configuration parameter. * No datastores are currently locked. The server will attempt to lock all datastores on behalf of the client for the entire unload operation. * The candidate datastore does not contain any edits that have not been committed. * No confirmed-commit operation is in progress. If all these conditions are met then the server will attempt to unload the specified module. The unload operation can fail for various reasons: * The client does not have write privileges for all data being deleted. This includes any top-level data nodes and any nested augment nodes in other modules. * The deletion of one or more nodes would cause the running datastore to fail any YANG validation tests in RFC 6020, sec. 8.3.3. * Server resource errors occur "; input { ncx:default-parm module; leaf module { type nt:NcxName; mandatory true; description "The name of the module to unload."; } uses delete-config-parm; } } rpc replay-config { ncx:hidden; ncx:abstract; description "Replay the running config for SIL components that have reset during operation."; // TBD: leaf-list input parameter to select sub-trees to reload } rpc load-bundle { nacm:default-deny-all; description "Load a SIL bundle into the server, if it is not already loaded."; input { ncx:default-parm bundle; leaf bundle { description "Name of the SIL bundle to load."; mandatory true; type nt:NcxName; } uses yumaapp:DeviationParm; uses save-config-parm; } } rpc unload-bundle { nacm:default-deny-all; description "Unload a SIL bundle from the server, if it is loaded."; input { ncx:default-parm bundle; leaf bundle { description "Name of the SIL bundle to unload."; mandatory true; type nt:NcxName; } uses delete-config-parm; } } augment /nc:commit/nc:input { leaf comment { type string { length "0 .. 1024"; } description "User provided comment to add to audit log for this commit operation."; } } grouping with-owners-parm { leaf with-owners { type empty; description "Include the 'ywx:owner' attribute in the response for nodes that have stored owner names. The --save-owners CLI parameter for the server must be set to 'complex' or 'all' for any owner names to be saved."; } } augment /nc:get-config/nc:input { uses with-owners-parm; uses rc:depth-parameter; } augment /nc:get/nc:input { uses with-owners-parm; uses rc:depth-parameter; } augment /nc:copy-config/nc:input { uses with-owners-parm; uses rc:depth-parameter; } grouping save-config-parm { leaf save-config { type boolean; default false; description "If 'true' then save the module or bundle load configuration in the --confdir directory, if the load or load-bundle operation is completed without errors. Ignored if the --no-config CLI parameter is used or the --confdir CLI parameter is not specified and no default configuration directory is found. A configuration file is created or replaced in this directory with the name .conf."; } } grouping delete-config-parm { leaf delete-config { type boolean; default false; description "If 'true' then delete the module or bundle load configuration in the --confdir directory, if the unload or unload-bundle operation is completed without errors. Ignored if the --no-config CLI parameter is used or the --confdir CLI parameter is not specified and no default configuration directory is found. A configuration file is deleted in this directory with the name .conf."; } } /* !!! removed augment /yuma-sys:load/yuma-sys:input { uses save-config-parm; } */ rpc load { nacm:default-deny-all; description "Load a module into the server, if it is not already loaded. Returns the module revision date (or today's date if none), of the module that was loaded, or an error if not found or the module found had errors and was not loaded successfully. If the module is already loaded, then the revision date will simply be returned."; input { ncx:default-parm module; leaf module { description "Name of the module to load."; mandatory true; type nt:NcxName; } leaf revision { description "Module revision to load."; type nt:Date; } uses yumaapp:DeviationParm; uses save-config-parm; } output { leaf mod-revision { description "Revision date of the module in use by the server. Will only be present if the module has a version"; type nt:Date; } } } }