Bug 5679 - add new module ietf-restconf 55/49555/4
authorJakub Toth <jatoth@cisco.com>
Mon, 19 Dec 2016 13:50:34 +0000 (14:50 +0100)
committerJakub Toth <jatoth@cisco.com>
Tue, 20 Dec 2016 17:07:44 +0000 (17:07 +0000)
Change-Id: Ia9aa9a6c2ed349c9133e005fa901ff70aec757f7
Signed-off-by: Jakub Toth <jatoth@cisco.com>
features/restconf/pom.xml
features/restconf/src/main/features/features.xml
restconf/models/ietf-restconf/pom.xml [new file with mode: 0644]
restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang [new file with mode: 0644]
restconf/models/pom.xml
restconf/restconf-artifacts/pom.xml
restconf/sal-rest-connector/pom.xml

index 19f30c770ef334b3da41a84317ebdcfa8f071d5c..e971f412d45c040e62ca553d620ff136fd2feed1 100644 (file)
       <artifactId>ietf-restconf-monitoring</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>ietf-restconf</artifactId>
+      <version>${project.version}</version>
+    </dependency>
 
   </dependencies>
   <scm>
index acdfd28755a0139095899694777095d23b729840..ebe8cff7ff45369e32a19df8935b856457bf2e4e 100644 (file)
@@ -30,6 +30,7 @@
         <feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
         <feature version='[4.0.30,4.1.0)'>odl-netty</feature>
         <feature>war</feature>
+        <bundle>mvn:org.opendaylight.netconf/ietf-restconf/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.netconf/ietf-yang-library/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.netconf/ietf-restconf-monitoring/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.netconf/sal-rest-connector/{{VERSION}}</bundle>
diff --git a/restconf/models/ietf-restconf/pom.xml b/restconf/models/ietf-restconf/pom.xml
new file mode 100644 (file)
index 0000000..f5b4fdb
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>0.10.0-SNAPSHOT</version>
+        <relativePath>../../../binding/binding-parent</relativePath>
+    </parent>
+
+    <groupId>org.opendaylight.netconf</groupId>
+    <artifactId>ietf-restconf</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>${project.artifactId}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-inet-types-2013-07-15</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-yang-types-20130715</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang b/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang
new file mode 100644 (file)
index 0000000..2f642de
--- /dev/null
@@ -0,0 +1,256 @@
+module ietf-restconf {
+  yang-version 1.1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-restconf";
+  prefix "rc";
+
+  organization
+    "IETF NETCONF (Network Configuration) Working Group";
+
+  contact
+    "WG Web:   <http://tools.ietf.org/wg/netconf/>
+     WG List:  <mailto:netconf@ietf.org>
+     Author:   Andy Bierman
+               <mailto:andy@yumaworks.com>
+     Author:   Martin Bjorklund
+               <mailto:mbj@tail-f.com>
+     Author:   Kent Watsen
+               <mailto:kwatsen@juniper.net>";
+
+  description
+    "This module contains conceptual YANG specifications
+     for basic RESTCONF media type definitions used in
+     RESTCONF protocol messages.
+     Note that the YANG definitions within this module do not
+     represent configuration data of any kind.
+     The 'restconf-media-type' YANG extension statement
+     provides a normative syntax for XML and JSON message
+     encoding purposes.
+     Copyright (c) 2016 IETF Trust 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 Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+     This version of this YANG module is part of RFC XXXX; see
+     the RFC itself for full legal notices.";
+
+  // RFC Ed.: replace XXXX with actual RFC number and remove this
+  // note.
+
+  // RFC Ed.: remove this note
+  // Note: extracted from draft-ietf-netconf-restconf-17.txt
+
+  // RFC Ed.: update the date below with the date of RFC publication
+  // and remove this note.
+  revision 2016-08-15 {
+    description
+      "Initial revision.";
+    reference
+      "RFC XXXX: RESTCONF Protocol.";
+  }
+
+  extension yang-data {
+    argument name {
+      yin-element true;
+    }
+    description
+      "This extension is used to specify a YANG data template which
+       represents conceptual data defined in YANG. It is
+       intended to describe hierarchical data independent of
+       protocol context or specific message encoding format.
+       Data definition statements within a yang-data extension
+       specify the generic syntax for the specific YANG data
+       template, whose name is the argument of the yang-data
+       extension statement.
+       Note that this extension does not define a media-type.
+       A specification using this extension MUST specify the
+       message encoding rules, including the content media type.
+       The mandatory 'name' parameter value identifies the YANG
+       data template that is being defined. It contains the
+       template name.
+       This extension is ignored unless it appears as a top-level
+       statement. It MUST contain data definition statements
+       that result in exactly one container data node definition.
+       An instance of a YANG data template can thus be translated
+       into an XML instance document, whose top-level element
+       corresponds to the top-level container.
+       The module name and namespace value for the YANG module using
+       the extension statement is assigned to instance document data
+       conforming to the data definition statements within
+       this extension.
+       The sub-statements of this extension MUST follow the
+       'data-def-stmt' rule in the YANG ABNF.
+       The XPath document root is the extension statement itself,
+       such that the child nodes of the document root are
+       represented by the data-def-stmt sub-statements within
+       this extension. This conceptual document is the context
+       for the following YANG statements:
+         - must-stmt
+         - when-stmt
+         - path-stmt
+         - min-elements-stmt
+         - max-elements-stmt
+         - mandatory-stmt
+         - unique-stmt
+         - ordered-by
+         - instance-identifier data type
+       The following data-def-stmt sub-statements are constrained
+       when used within a yang-data-resource extension statement.
+         - The list-stmt is not required to have a key-stmt defined.
+         - The if-feature-stmt is ignored if present.
+         - The config-stmt is ignored if present.
+         - The available identity values for any 'identityref'
+           leaf or leaf-list nodes is limited to the module
+           containing this extension statement, and the modules
+           imported into that module.
+      ";
+  }
+
+  rc:yang-data yang-errors {
+    uses errors;
+  }
+
+  rc:yang-data yang-api {
+    uses restconf;
+  }
+
+  grouping errors {
+    description
+      "A grouping that contains a YANG container
+       representing the syntax and semantics of a
+       YANG Patch errors report within a response message.";
+
+    container errors {
+      description
+        "Represents an error report returned by the server if
+         a request results in an error.";
+
+      list error {
+        description
+          "An entry containing information about one
+           specific error that occurred while processing
+           a RESTCONF request.";
+        reference "RFC 6241, Section 4.3";
+
+        leaf error-type {
+          type enumeration {
+            enum transport {
+              description "The transport layer";
+            }
+            enum rpc {
+              description "The rpc or notification layer";
+            }
+            enum protocol {
+              description "The protocol operation layer";
+            }
+            enum application {
+              description "The server application layer";
+            }
+          }
+          mandatory true;
+          description
+            "The protocol layer where the error occurred.";
+        }
+
+        leaf error-tag {
+          type string;
+          mandatory true;
+          description
+            "The enumerated error tag.";
+        }
+
+        leaf error-app-tag {
+          type string;
+          description
+            "The application-specific error tag.";
+        }
+
+        leaf error-path {
+          type instance-identifier;
+          description
+            "The YANG instance identifier associated
+             with the error node.";
+        }
+
+        leaf error-message {
+          type string;
+          description
+            "A message describing the error.";
+        }
+
+        anydata error-info {
+           description
+             "This anydata value MUST represent a container with
+             zero or more data nodes representing additional
+             error information.";
+        }
+      }
+    }
+  }
+
+  grouping restconf {
+    description
+      "Conceptual grouping representing the RESTCONF
+       root resource.";
+
+    container restconf {
+      description
+        "Conceptual container representing the RESTCONF
+         root resource.";
+
+      container data {
+        description
+          "Container representing the datastore resource.
+           Represents the conceptual root of all state data
+           and configuration data supported by the server.
+           The child nodes of this container can be any data
+           resource which are defined as top-level data nodes
+           from the YANG modules advertised by the server in
+           the ietf-yang-library module.";
+      }
+
+      container operations {
+        description
+          "Container for all operation resources.
+           Each resource is represented as an empty leaf with the
+           name of the RPC operation from the YANG rpc statement.
+           For example, the 'system-restart' RPC operation defined
+           in the 'ietf-system' module would be represented as
+           an empty leaf in the 'ietf-system' namespace. This is
+           a conceptual leaf, and will not actually be found in
+           the module:
+              module ietf-system {
+                leaf system-reset {
+                  type empty;
+                }
+              }
+           To invoke the 'system-restart' RPC operation:
+              POST /restconf/operations/ietf-system:system-restart
+           To discover the RPC operations supported by the server:
+              GET /restconf/operations
+           In XML the YANG module namespace identifies the module:
+             <system-restart
+                xmlns='urn:ietf:params:xml:ns:yang:ietf-system' />
+           In JSON the YANG module name identifies the module:
+             { 'ietf-system:system-restart' : [null] }
+          ";
+      }
+
+      leaf yang-library-version {
+        type string {
+          pattern '\d{4}-\d{2}-\d{2}';
+        }
+        config false;
+        mandatory true;
+        description
+          "Identifies the revision date of the ietf-yang-library
+           module that is implemented by this RESTCONF server.
+           Indicates the year, month, and day in YYYY-MM-DD
+           numeric format.";
+      }
+    }
+  }
+
+}
index c76a3ff59676b51aa75a401130e773dc2b051193..9712e52c3eec0d992f184dd89e930379d5fd8734 100644 (file)
@@ -22,5 +22,6 @@
   <modules>
     <module>ietf-yang-library</module>
     <module>ietf-restconf-monitoring</module>
+    <module>ietf-restconf</module>
   </modules>
 </project>
index 4b1a7efa49fbae8d13b74530632157a01f70c422..ef56ea9c6c6dc36b6d12dced43c7dcc435e7fc17 100644 (file)
 
     <dependencyManagement>
         <dependencies>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>ietf-restconf</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>ietf-yang-library</artifactId>
index 2afbaf91f7d7a4c339448a55ca59dbb4e6f44d12..098c1b3f0d618b1ec055bbd5ab2c19157e062857 100644 (file)
       <artifactId>ietf-restconf-monitoring</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>ietf-restconf</artifactId>
+      <version>${project.version}</version>
+    </dependency>
     <dependency>
       <groupId>net.java.dev.stax-utils</groupId>
       <artifactId>stax-utils</artifactId>