Adding OpenConfig YANG models.

Change-Id: I0a2fdd5826e80933cf4b9ae939ff3051acec02aa
diff --git a/models/openconfig/src/main/yang/optical-transport/openconfig-optical-amplifier.yang b/models/openconfig/src/main/yang/optical-transport/openconfig-optical-amplifier.yang
new file mode 100644
index 0000000..02b668c
--- /dev/null
+++ b/models/openconfig/src/main/yang/optical-transport/openconfig-optical-amplifier.yang
@@ -0,0 +1,403 @@
+module openconfig-optical-amplifier {
+
+  yang-version "1";
+
+  // namespace
+  namespace "http://openconfig.net/yang/optical-amplfier";
+
+  prefix "oc-opt-amp";
+
+  import openconfig-platform { prefix oc-platform; }
+  import openconfig-transport-line-common { prefix oc-line-com; }
+  import openconfig-types { prefix oc-types; }
+  import openconfig-extensions { prefix oc-ext; }
+
+
+  // meta
+  organization "OpenConfig working group";
+
+  contact
+    "OpenConfig working group
+    www.openconfig.net";
+
+  description
+    "This model describes configuration and operational state data
+    for optical amplifiers, deployed as part of a transport
+    line system.";
+
+  oc-ext:openconfig-version "0.3.0";
+
+  revision "2017-07-08" {
+    description
+      "Add monitor port type and refs to hw ports, ";
+    reference "0.3.0";
+  }
+
+  revision "2017-03-28" {
+    description
+      "Added min/max/avg stats, status for media channels, OCM, APS";
+    reference "0.2.0";
+  }
+
+  revision "2016-03-31" {
+    description
+      "Initial public release";
+    reference "0.1.0";
+  }
+
+
+  // extension statements
+
+  // feature statements
+
+  // identity statements
+
+  identity OPTICAL_AMPLIFIER_TYPE {
+    description
+      "Type definition for different types of optical amplifiers";
+  }
+
+  identity EDFA {
+    base OPTICAL_AMPLIFIER_TYPE;
+    description
+      "Erbium doped fiber amplifer (EDFA)";
+  }
+
+  identity FORWARD_RAMAN {
+    base OPTICAL_AMPLIFIER_TYPE;
+    description
+      "Forward pumping Raman amplifier";
+  }
+
+  identity BACKWARD_RAMAN {
+    base OPTICAL_AMPLIFIER_TYPE;
+    description
+      "Backward pumping Raman amplifier";
+  }
+
+  identity HYBRID {
+    base OPTICAL_AMPLIFIER_TYPE;
+    description
+      "Hybrid backward pumping Raman + EDFA amplifier";
+  }
+
+  identity GAIN_RANGE {
+    description
+      "Base type for expressing the gain range for a switched gain
+      amplifier.  The gain range is expressed as a generic setting,
+      e.g., LOW/MID/HIGH. The actual db range will be determined
+      by the implementation.";
+  }
+
+  identity LOW_GAIN_RANGE {
+    base GAIN_RANGE;
+    description
+      "LOW gain range setting";
+  }
+
+  identity MID_GAIN_RANGE {
+    base GAIN_RANGE;
+    description
+      "MID gain range setting";
+  }
+
+  identity HIGH_GAIN_RANGE {
+    base GAIN_RANGE;
+    description
+      "HIGH gain range setting";
+  }
+
+  identity FIXED_GAIN_RANGE {
+    base GAIN_RANGE;
+    description
+      "Fixed or non-switched gain amplfier";
+  }
+
+  identity OPTICAL_AMPLIFIER_MODE {
+    description
+      "Type definition for different types of optical amplifier
+      operating modes";
+  }
+
+  identity CONSTANT_POWER {
+      base OPTICAL_AMPLIFIER_MODE;
+      description
+        "Constant power mode";
+  }
+
+  identity CONSTANT_GAIN {
+      base OPTICAL_AMPLIFIER_MODE;
+      description
+        "Constant gain mode";
+  }
+
+
+  // grouping statements
+
+  grouping optical-amplifier-config {
+    description
+      "Configuration data for optical amplifiers";
+
+    leaf name {
+      type string;
+      description
+        "User-defined name assigned to identify a specific amplifier
+        in the device";
+    }
+
+    leaf type {
+      type identityref {
+        base OPTICAL_AMPLIFIER_TYPE;
+      }
+      description
+        "Type of the amplifier";
+    }
+
+    leaf target-gain {
+      type decimal64 {
+        fraction-digits 2;
+        range 0..max;
+      }
+      units dB;
+      description
+        "Positive gain applied by the amplifier.";
+    }
+
+    leaf target-gain-tilt {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      units dB;
+      description
+        "Gain tilt control";
+    }
+
+    leaf gain-range {
+      type identityref {
+        base GAIN_RANGE;
+      }
+      description
+        "Selected gain range.  The gain range is a platform-defined
+        value indicating the switched gain amplifier setting";
+    }
+
+    leaf amp-mode {
+      type identityref {
+        base OPTICAL_AMPLIFIER_MODE;
+      }
+      description
+        "The operating mode of the amplifier";
+    }
+
+    leaf target-output-power {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      units dBm;
+      description
+        "Output optical power of the amplifier.";
+    }
+
+    leaf enabled {
+      type boolean;
+      description
+        "Turns power on / off to the amplifiers gain module.";
+    }
+
+  }
+
+  grouping optical-amplifier-state {
+    description
+      "Operational state data for optical amplifiers";
+
+    leaf ingress-port {
+      type leafref {
+        path "/oc-platform:components/oc-platform:component/" +
+          "oc-platform:name";
+      }
+      description
+        "Reference to system-supplied name of the amplifier ingress
+        port. This leaf is only valid for ports of type INGRESS.";
+    }
+
+    leaf egress-port {
+      type leafref {
+        path "/oc-platform:components/oc-platform:component/" +
+          "oc-platform:name";
+      }
+      description
+        "Reference to system-supplied name of the amplifier egress
+        port. This leaf is only valid for ports of type EGRESS.";
+    }
+
+    container actual-gain {
+      description
+        "The actual gain applied by the amplifier in units of
+        0.01dB. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dB;
+    }
+
+    container actual-gain-tilt {
+      description
+        "The actual tilt applied by the amplifier in units of
+        0.01dB. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dB;
+    }
+
+    container input-power-total {
+      description
+        "The total input optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container input-power-c-band {
+      description
+        "The C band (consisting of approximately 191 to 195 THz or
+        1530nm to 1565 nm) input optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container input-power-l-band {
+      description
+        "The L band (consisting of approximately 184 to 191 THz or
+        1565 to 1625 nm) input optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container output-power-total {
+      description
+        "The total output optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container output-power-c-band {
+      description
+        "The C band (consisting of approximately 191 to 195 THz or
+        1530nm to 1565 nm)output optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container output-power-l-band {
+      description
+        "The L band (consisting of approximately 184 to 191 THz or
+        1565 to 1625 nm)output optical power of this port in units
+        of 0.01dBm. If avg/min/max statistics are not supported,
+        just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+
+    container laser-bias-current {
+      description
+        "The current applied by the system to the transmit laser to
+        achieve the output power. The current is expressed in mA
+        with up to two decimal precision. If avg/min/max statistics
+        are not supported, just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-mA;
+    }
+
+    container optical-return-loss {
+      description
+        "The optical return loss (ORL) is the ratio of the light
+        reflected back into the port to the light launched out of
+        the port. ORL is in units of 0.01dBm. If avg/min/max
+        statistics are not supported, just supply the instant value";
+
+      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
+    }
+  }
+
+  grouping optical-amplifier-top {
+    description
+      "Top-level grouping for optical amplifier data";
+
+    container optical-amplifier {
+      description
+        "Enclosing container for amplifiers and supervisory channels";
+
+      container amplifiers {
+        description
+          "Enclosing container for list of amplifiers";
+
+        list amplifier {
+          key "name";
+          description
+            "List of optical amplifiers present in the device";
+
+          leaf name {
+            type leafref {
+              path "../config/name";
+            }
+            description
+              "Reference to the name of the amplifier";
+          }
+
+          container config {
+            description
+              "Configuration data for the amplifier";
+
+            uses optical-amplifier-config;
+          }
+
+          container state {
+
+            config false;
+
+            description
+              "Operational state data for the amplifier";
+
+            uses optical-amplifier-config;
+            uses optical-amplifier-state;
+          }
+        }
+      }
+
+      container supervisory-channels {
+        description
+          "Enclosing container for list of supervisory channels";
+
+        list supervisory-channel {
+          key "interface";
+          description
+            "List of supervisory channels";
+
+          leaf interface {
+            type leafref {
+              path "../config/interface";
+            }
+            description
+              "Reference to the interface of the supervisory channel";
+          }
+
+          uses oc-line-com:optical-osc-top;
+        }
+      }
+    }
+  }
+
+  // data definition statements
+
+  uses optical-amplifier-top;
+
+
+}