Decouple config and netconf subsystems.
[controller.git] / opendaylight / netconf / sal-netconf-connector / src / test / resources / schemas / config-test-rpc.yang
diff --git a/opendaylight/netconf/sal-netconf-connector/src/test/resources/schemas/config-test-rpc.yang b/opendaylight/netconf/sal-netconf-connector/src/test/resources/schemas/config-test-rpc.yang
new file mode 100644 (file)
index 0000000..18a4ead
--- /dev/null
@@ -0,0 +1,176 @@
+module config-test-rpc {
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:rpc:config:defs";
+    prefix "rpc";
+
+    organization
+    "Cisco Systems, Inc.";
+
+    contact
+    "lsedlak@cisco.com";
+
+    description "Test model containing hacked definition of rpc edit-config and definitions for
+        get and get-config rpc operations.
+        The rpc definition is copied from rfc 6241 Appendix C: http://tools.ietf.org/html/rfc6241#appendix-C";
+
+    revision 2014-07-21 {
+        description "Initial revision.";
+    }
+
+    extension get-filter-element-attributes {
+          description
+            "If this extension is present within an 'anyxml'
+             statement named 'filter', which must be conceptually
+             defined within the RPC input section for the <get>
+             and <get-config> protocol operations, then the
+             following unqualified XML attribute is supported
+             within the <filter> element, within a <get> or
+             <get-config> protocol operation:
+
+               type : optional attribute with allowed
+                      value strings 'subtree' and 'xpath'.
+                      If missing, the default value is 'subtree'.
+
+             If the 'xpath' feature is supported, then the
+             following unqualified XML attribute is
+             also supported:
+
+               select: optional attribute containing a
+                       string representing an XPath expression.
+                       The 'type' attribute must be equal to 'xpath'
+                       if this attribute is present.";
+    }
+
+    rpc edit-config {
+        description "The <edit-config> operation loads all or part of a specified
+             configuration to the specified target configuration.";
+
+        reference "RFC 6241, Section 7.2";
+
+        input {
+            container target {
+                description "Particular configuration to edit.";
+
+                choice config-target {
+                    mandatory true;
+                    description "The configuration target.";
+
+                    leaf candidate {
+                        if-feature candidate;
+                        type empty;
+                        description "The candidate configuration is the config target.";
+                    }
+
+                    leaf running {
+                        if-feature writable-running;
+                        type empty;
+                        description "The running configuration is the config source.";
+                    }
+                }
+            }
+
+            choice edit-content {
+                mandatory true;
+                description "The content for the edit operation.";
+
+                anyxml config {
+                    description
+                      "Inline Config content.";
+                }
+
+                leaf url {
+                    if-feature url;
+                    type string;
+                    description
+                      "URL-based config content.";
+                }
+            }
+        }
+    }
+
+    rpc get-config {
+      description
+        "Retrieve all or part of a specified configuration.";
+
+      reference "RFC 6241, Section 7.1";
+
+      input {
+        container source {
+          description "Particular configuration to retrieve.";
+
+            choice config-source {
+                mandatory true;
+                description
+                  "The configuration to retrieve.";
+                leaf candidate {
+                  if-feature candidate;
+                  type empty;
+                  description
+                    "The candidate configuration is the config source.";
+                }
+                leaf running {
+                  type empty;
+                  description
+                    "The running configuration is the config source.";
+                }
+                leaf startup {
+                  if-feature startup;
+                  type empty;
+                  description
+                    "The startup configuration is the config source.
+                     This is optional-to-implement on the server because
+                     not all servers will support filtering for this
+                     datastore.";
+                }
+            }
+        }
+
+        anyxml filter {
+            description "Subtree or XPath filter to use.";
+                get-filter-element-attributes;
+            }
+        }
+
+        output {
+            anyxml data {
+              description
+                "Copy of the source datastore subset that matched
+                 the filter criteria (if any).  An empty data container
+                 indicates that the request did not produce any results.";
+            }
+        }
+    }
+
+    rpc get {
+        description "Retrieve running configuration and device state information.";
+
+        reference "RFC 6241, Section 7.7";
+
+        input {
+            anyxml filter {
+              description
+                "This parameter specifies the portion of the system
+                 configuration and state data to retrieve.";
+              get-filter-element-attributes;
+            }
+        }
+
+        output {
+            anyxml data {
+              description
+                "Copy of the running datastore subset and/or state
+                 data that matched the filter criteria (if any).
+                 An empty data container indicates that the request did not
+                 produce any results.";
+            }
+        }
+    }
+
+      rpc discard-changes {
+        if-feature candidate;
+
+        description
+          "Revert the candidate configuration to the current
+           running configuration.";
+        reference "RFC 6241, Section 8.3.4.2";
+      }
+}