netconfcentral logo

openconfig-optical-attenuator@2019-07-19



  module openconfig-optical-attenuator {

    yang-version 1;

    namespace
      "http://openconfig.net/yang/optical-attenuator";

    prefix oc-opt-att;

    import openconfig-platform {
      prefix oc-platform;
    }
    import openconfig-types {
      prefix oc-types;
    }
    import openconfig-extensions {
      prefix oc-ext;
    }

    organization "OpenConfig working group";

    contact
      "OpenConfig working group
    www.openconfig.net";

    description
      "This model describes configuration and operational state data
    for variable optical attenuators, deployed as part of a transport
    line system.";

    revision "2019-07-19" {
      description "Initial release";
      reference
        "0.1.0";

    }

    oc-ext:openconfig-version "0.1.0";
    oc-ext:regexp-posix;
    oc-ext:catalog-organization "openconfig";
    oc-ext:origin "openconfig";

    identity OPTICAL_ATTENUATOR_MODE {
      base 
      description
        "Type definition for different types of optical attenuator
      operating modes";
    }

    identity CONSTANT_POWER {
      base OPTICAL_ATTENUATOR_MODE;
      description "Constant power mode";
    }

    identity CONSTANT_ATTENUATION {
      base OPTICAL_ATTENUATOR_MODE;
      description
        "Constant attenuation mode";
    }

    grouping optical-attenuator-config {
      description
        "Configuration data for optical attenuators";
      leaf name {
        type string;
        description
          "User-defined name assigned to identify a specific attenuator
        in the device";
      }

      leaf attenuation-mode {
        type identityref {
          base OPTICAL_ATTENUATOR_MODE;
        }
        description
          "The operating mode of the attenuator";
      }

      leaf target-output-power {
        type decimal64 {
          fraction-digits 2;
        }
        units "dB";
        description
          "Power level set on the output of attenuator.  This leaf is
        only relevant when in CONSTANT_POWER mode.";
      }

      leaf attenuation {
        type decimal64 {
          fraction-digits 2;
          range "0..max";
        }
        units "dB";
        description
          "Attenuation applied by the attenuator.  This leaf is only
        relevant when in CONSTANT_ATTENUATION mode.";
      }

      leaf enabled {
        type boolean;
        description
          "When true, attenuator is set to specified attenuation or varies to
         maintain constant output power.  When false, the attenuator is set
         max attenuation or blocked.";
      }
    }  // grouping optical-attenuator-config

    grouping optical-attenuator-state {
      description
        "Operational state data for optical attenuators";
      leaf component {
        type leafref {
          path
            "/oc-platform:components/oc-platform:component/"
              + "oc-platform:name";
        }
        description
          "Reference to the system-supplied physical component that
        the attenuator block is contained within. Multiple
        attenuator blocks may be contained within the same
        physical component.";
      }

      leaf ingress-port {
        type leafref {
          path
            "/oc-platform:components/oc-platform:component/"
              + "oc-platform:name";
        }
        description
          "Reference to system-supplied name of the attenuator 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 attenuator egress
        port. This leaf is only valid for ports of type EGRESS.";
      }

      container actual-attenuation {
        description
          "The actual attenuation applied by the attenuator 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-attenuation

      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-total

      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;
      }  // container optical-return-loss
    }  // grouping optical-attenuator-state

    grouping optical-attenuator-top {
      description
        "Top-level grouping for optical attenuator data";
      container optical-attenuator {
        description
          "Enclosing container for attenuators";
        container attenuators {
          description
            "Enclosing container for list of attenuators";
          list attenuator {
            key "name";
            description
              "List of variable optical attenuators present in the device";
            leaf name {
              type leafref {
                path "../config/name";
              }
              description
                "Reference to the name of the attenuator";
            }

            container config {
              description
                "Configuration data for the attenuator";
              uses optical-attenuator-config;
            }  // container config

            container state {
              config false;
              description
                "Operational state data for the attenuator";
              uses optical-attenuator-config;

              uses optical-attenuator-state;
            }  // container state
          }  // list attenuator
        }  // container attenuators
      }  // container optical-attenuator
    }  // grouping optical-attenuator-top

    uses optical-attenuator-top;
  }  // module openconfig-optical-attenuator