OpenConfig model for Infinera XT3300

Change-Id: I400c9146892932afc97d1a32e425722fd7c92345
This commit is contained in:
hiroki 2018-05-08 13:23:37 -07:00 committed by Yuta HIGUCHI
parent e8947b06cf
commit 4ecc871a22
16 changed files with 6828 additions and 0 deletions

View File

@ -0,0 +1,16 @@
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//models/ietf:onos-models-ietf',
]
APPS = [
'org.onosproject.models.ietf',
]
yang_model(
app_name = 'org.onosproject.models.openconfig-infinera',
title = 'OpenConfig Infinera XT3300 YANG Models',
custom_registrator = False,
deps = COMPILE_DEPS,
required_apps = APPS,
)

View File

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017-present Open Networking Foundation
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<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.onosproject</groupId>
<artifactId>onos-models</artifactId>
<version>1.14.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-models-openconfig-infinera</artifactId>
<packaging>bundle</packaging>
<description>OpenConfig Infinera YANG models</description>
<properties>
<onos.app.name>org.onosproject.models.openconfig-infinera</onos.app.name>
</properties>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-model</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-apps-yang</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-models-ietf</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions combine.children="append">
<Include-Resource>yang/resources/YangMetaData.ser=target/classes/yang/resources/YangMetaData.ser</Include-Resource>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-compiler-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.onosproject</groupId>
<artifactId>onos-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>onos-yang-plugin-workaround</id>
<!-- yang plugin cannot handle non-clean compilation -->
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>target/generated-sources</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<!-- FIXME: YANG tool generates problematic code -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-XepDisableAllChecks</arg>
<arg>-Xep:BetaApi:OFF</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-clean-plugin
</artifactId>
<versionRange>
[3.0.0,)
</versionRange>
<goals>
<goal>clean</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
module openconfig-extensions {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/openconfig-ext";
prefix "ocext";
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module provides extensions to the YANG language to allow
OpenConfig specific functionality and meta-data to be defined.";
revision "2015-10-09" {
description
"Initial OpenConfig public release";
}
revision "2015-10-05" {
description
"Initial revision";
reference "TBD";
}
// extension statements
extension openconfig-version {
argument "semver" {
yin-element false;
}
description
"The OpenConfig version number for the module. This is
expressed as a semantic version number of the form:
x.y.z
where:
* x corresponds to the major version,
* y corresponds to a minor version,
* z corresponds to a patch version.
This version corresponds to the model file within which it is
defined, and does not cover the whole set of OpenConfig models.
Where several modules are used to build up a single block of
functionality, the same module version is specified across each
file that makes up the module.
A major version number of 0 indicates that this model is still
in development (whether within OpenConfig or with industry
partners), and is potentially subject to change.
Following a release of major version 1, all modules will
increment major revision number where backwards incompatible
changes to the model are made.
The minor version is changed when features are added to the
model that do not impact current clients use of the model.
The patch-level version is incremented when non-feature changes
(such as bugfixes or clarifications to human-readable
descriptions that do not impact model functionality) are made
that maintain backwards compatibility.
The version number is stored in the module meta-data.";
}
}

View File

@ -0,0 +1,355 @@
module openconfig-if-ethernet {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/interfaces/ethernet";
prefix "oc-eth";
// import some basic types
import openconfig-interfaces {
prefix oc-if;
revision-date "2016-05-26";
}
import iana-if-type {
prefix ift;
revision-date "2016-11-23";
}
import ietf-yang-types {
prefix yang;
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
netopenconfig@googlegroups.com";
description
"Model for managing Ethernet interfaces -- augments the IETF YANG
model for interfaces described by RFC 7223";
oc-ext:openconfig-version "1.1.0";
revision "2016-12-22" {
description
"Fixes to Ethernet interfaces model";
reference "1.1.0";
}
// extension statements
// feature statements
// identity statements
identity ETHERNET_SPEED {
description "base type to specify available Ethernet link
speeds";
}
identity SPEED_10MB {
base ETHERNET_SPEED;
description "10 Mbps Ethernet";
}
identity SPEED_100MB {
base ETHERNET_SPEED;
description "100 Mbps Ethernet";
}
identity SPEED_1GB {
base ETHERNET_SPEED;
description "1 GBps Ethernet";
}
identity SPEED_10GB {
base ETHERNET_SPEED;
description "10 GBps Ethernet";
}
identity SPEED_25GB {
base ETHERNET_SPEED;
description "25 GBps Ethernet";
}
identity SPEED_40GB {
base ETHERNET_SPEED;
description "40 GBps Ethernet";
}
identity SPEED_50GB {
base ETHERNET_SPEED;
description "50 GBps Ethernet";
}
identity SPEED_100GB {
base ETHERNET_SPEED;
description "100 GBps Ethernet";
}
identity SPEED_UNKNOWN {
base ETHERNET_SPEED;
description
"Interface speed is unknown. Systems may report
speed UNKNOWN when an interface is down or unpopuplated (e.g.,
pluggable not present).";
}
// typedef statements
// grouping statements
grouping ethernet-interface-config {
description "Configuration items for Ethernet interfaces";
leaf mac-address {
type yang:mac-address;
description
"Assigns a MAC address to the Ethernet interface. If not
specified, the corresponding operational state leaf is
expected to show the system-assigned MAC address.";
}
leaf auto-negotiate {
type boolean;
default true;
description
"Set to TRUE to request the interface to auto-negotiate
transmission parameters with its peer interface. When
set to FALSE, the transmission parameters are specified
manually.";
reference
"IEEE 802.3-2012 auto-negotiation transmission parameters";
}
leaf duplex-mode {
type enumeration {
enum FULL {
description "Full duplex mode";
}
enum HALF {
description "Half duplex mode";
}
}
description
"When auto-negotiate is TRUE, this optionally sets the
duplex mode that will be advertised to the peer. If
unspecified, the interface should negotiate the duplex mode
directly (typically full-duplex). When auto-negotiate is
FALSE, this sets the duplex mode on the interface directly.";
}
leaf port-speed {
type identityref {
base ETHERNET_SPEED;
}
description
"When auto-negotiate is TRUE, this optionally sets the
port-speed mode that will be advertised to the peer for
negotiation. If unspecified, it is expected that the
interface will select the highest speed available based on
negotiation. When auto-negotiate is set to FALSE, sets the
link speed to a fixed value -- supported values are defined
by ETHERNET_SPEED identities";
}
leaf enable-flow-control {
type boolean;
default false;
description
"Enable or disable flow control for this interface.
Ethernet flow control is a mechanism by which a receiver
may send PAUSE frames to a sender to stop transmission for
a specified time.
This setting should override auto-negotiated flow control
settings. If left unspecified, and auto-negotiate is TRUE,
flow control mode is negotiated with the peer interface.";
reference
"IEEE 802.3x";
}
}
grouping ethernet-interface-state-counters {
description
"Ethernet-specific counters and statistics";
// ingress counters
leaf in-mac-control-frames {
type yang:counter64;
description
"MAC layer control frames received on the interface";
}
leaf in-mac-pause-frames {
type yang:counter64;
description
"MAC layer PAUSE frames received on the interface";
}
leaf in-oversize-frames {
type yang:counter64;
description
"Number of oversize frames received on the interface";
}
leaf in-jabber-frames {
type yang:counter64;
description
"Number of jabber frames received on the
interface. Jabber frames are typically defined as oversize
frames which also have a bad CRC. Implementations may use
slightly different definitions of what constitutes a jabber
frame. Often indicative of a NIC hardware problem.";
}
leaf in-fragment-frames {
type yang:counter64;
description
"Number of fragment frames received on the interface.";
}
leaf in-8021q-frames {
type yang:counter64;
description
"Number of 802.1q tagged frames received on the interface";
}
leaf in-crc-errors {
type yang:counter64;
description
"Number of receive error events due to FCS/CRC check
failure";
}
// egress counters
leaf out-mac-control-frames {
type yang:counter64;
description
"MAC layer control frames sent on the interface";
}
leaf out-mac-pause-frames {
type yang:counter64;
description
"MAC layer PAUSE frames sent on the interface";
}
leaf out-8021q-frames {
type yang:counter64;
description
"Number of 802.1q tagged frames sent on the interface";
}
}
grouping ethernet-interface-state {
description
"Grouping for defining Ethernet-specific operational state";
leaf hw-mac-address {
type yang:mac-address;
description
"Represenets the 'burned-in', or system-assigned, MAC
address for the Ethernet interface.";
}
leaf effective-speed {
type uint32;
units Mbps;
description
"Reports the effective speed of the interface, e.g., the
negotiated speed if auto-negotiate is enabled";
}
leaf negotiated-duplex-mode {
type enumeration {
enum FULL {
description "Full duplex mode";
}
enum HALF {
description "Half duplex mode";
}
}
description
"When auto-negotiate is set to TRUE, and the interface has
completed auto-negotiation with the remote peer, this value
shows the duplex mode that has been negotiated.";
}
leaf negotiated-port-speed {
type identityref {
base ETHERNET_SPEED;
}
description
"When auto-negotiate is set to TRUE, and the interface has
completed auto-negotiation with the remote peer, this value
shows the interface speed that has been negotiated.";
}
container counters {
description "Ethernet interface counters";
uses ethernet-interface-state-counters;
}
}
// data definition statements
grouping ethernet-top {
description "top-level Ethernet config and state containers";
container ethernet {
description
"Top-level container for ethernet configuration
and state";
container config {
description "Configuration data for ethernet interfaces";
uses ethernet-interface-config;
}
container state {
config false;
description "State variables for Ethernet interfaces";
uses ethernet-interface-config;
uses ethernet-interface-state;
}
}
}
// augment statements
augment "/oc-if:interfaces/oc-if:interface" {
description "Adds addtional Ethernet-specific configuration to
interfaces model";
uses ethernet-top {
when "oc-if:state/oc-if:type = 'ift:ethernetCsmacd'" {
description "Additional interface configuration parameters when
the interface type is Ethernet";
}
}
}
// rpc statements
// notification statements
}

View File

@ -0,0 +1,891 @@
module openconfig-interfaces {
// namespace
namespace "http://openconfig.net/yang/interfaces";
prefix "oc-if";
// import some basic types
import ietf-interfaces {
prefix ietf-if;
}
import ietf-yang-types {
prefix yang;
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// import tailf-common {prefix "tailf";}
// tailf:export netconf;
// tailf:export rest;
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
netopenconfig@googlegroups.com";
description
"Model for managing network interfaces and subinterfaces. This
module also defines convenience types / groupings for other
models to create references to interfaces:
base-interface-ref (type) - reference to a base interface
interface-ref (grouping) - container for reference to a
interface + subinterface
interface-ref-state (grouping) - container for read-only
(opstate) reference to interface + subinterface
This model reuses data items defined in the IETF YANG model for
interfaces described by RFC 7223 with an alternate structure
(particularly for operational state data) and and with
additional configuration items.";
oc-ext:openconfig-version "1.0.2";
revision "2016-05-26" {
description
"OpenConfig public release";
reference "1.0.2";
}
// typedef statements
typedef base-interface-ref {
type leafref {
path "/oc-if:interfaces/oc-if:interface/oc-if:name";
}
description
"Reusable type for by-name reference to a base interface.
This type may be used in cases where ability to reference
a subinterface is not required.";
}
typedef interface-id {
type string;
description
"User-defined identifier for an interface, generally used to
name a interface reference. The id can be arbitrary but a
useful convention is to use a combination of base interface
name and subinterface index.";
}
// grouping statements
grouping interface-ref-common {
description
"Reference leafrefs to interface / subinterface";
leaf interface {
type leafref {
path "/oc-if:interfaces/oc-if:interface/oc-if:name";
}
description
"Reference to a base interface. If a reference to a
subinterface is required, this leaf must be specified
to indicate the base interface.";
}
leaf subinterface {
type leafref {
path "/oc-if:interfaces/" +
"oc-if:interface[oc-if:name=current()/../interface]/" +
"oc-if:subinterfaces/oc-if:subinterface/oc-if:index";
}
description
"Reference to a subinterface -- this requires the base
interface to be specified using the interface leaf in
this container. If only a reference to a base interface
is requuired, this leaf should not be set.";
}
}
grouping interface-ref-state-container {
description
"Reusable opstate w/container for a reference to an
interface or subinterface";
container state {
config false;
description
"Operational state for interface-ref";
uses interface-ref-common;
}
}
grouping interface-ref {
description
"Reusable definition for a reference to an interface or
subinterface";
container interface-ref {
description
"Reference to an interface or subinterface";
container config {
description
"Configured reference to interface / subinterface";
uses interface-ref-common;
}
uses interface-ref-state-container;
}
}
grouping interface-ref-state {
description
"Reusable opstate w/container for a reference to an
interface or subinterface";
container interface-ref {
description
"Reference to an interface or subinterface";
uses interface-ref-state-container;
}
}
grouping interface-common-config {
description
"Configuration data data nodes common to physical interfaces
and subinterfaces";
leaf name {
type string;
description
"[adapted from IETF interfaces model (RFC 7223)]
The name of the interface.
A device MAY restrict the allowed values for this leaf,
possibly depending on the type of the interface.
For system-controlled interfaces, this leaf is the
device-specific name of the interface. The 'config false'
list interfaces/interface[name]/state contains the currently
existing interfaces on the device.
If a client tries to create configuration for a
system-controlled interface that is not present in the
corresponding state list, the server MAY reject
the request if the implementation does not support
pre-provisioning of interfaces or if the name refers to
an interface that can never exist in the system. A
NETCONF server MUST reply with an rpc-error with the
error-tag 'invalid-value' in this case.
The IETF model in RFC 7223 provides YANG features for the
following (i.e., pre-provisioning and arbitrary-names),
however they are omitted here:
If the device supports pre-provisioning of interface
configuration, the 'pre-provisioning' feature is
advertised.
If the device allows arbitrarily named user-controlled
interfaces, the 'arbitrary-names' feature is advertised.
When a configured user-controlled interface is created by
the system, it is instantiated with the same name in the
/interfaces/interface[name]/state list.";
reference
"RFC 7223: A YANG Data Model for Interface Management";
}
leaf description {
type string;
description
"[adapted from IETF interfaces model (RFC 7223)]
A textual description of the interface.
A server implementation MAY map this leaf to the ifAlias
MIB object. Such an implementation needs to use some
mechanism to handle the differences in size and characters
allowed between this leaf and ifAlias. The definition of
such a mechanism is outside the scope of this document.
Since ifAlias is defined to be stored in non-volatile
storage, the MIB implementation MUST map ifAlias to the
value of 'description' in the persistently stored
datastore.
Specifically, if the device supports ':startup', when
ifAlias is read the device MUST return the value of
'description' in the 'startup' datastore, and when it is
written, it MUST be written to the 'running' and 'startup'
datastores. Note that it is up to the implementation to
decide whether to modify this single leaf in 'startup' or
perform an implicit copy-config from 'running' to
'startup'.
If the device does not support ':startup', ifAlias MUST
be mapped to the 'description' leaf in the 'running'
datastore.";
reference
"RFC 2863: The Interfaces Group MIB - ifAlias";
}
leaf enabled {
type boolean;
default "true";
description
"[adapted from IETF interfaces model (RFC 7223)]
This leaf contains the configured, desired state of the
interface.
Systems that implement the IF-MIB use the value of this
leaf in the 'running' datastore to set
IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
has been initialized, as described in RFC 2863.
Changes in this leaf in the 'running' datastore are
reflected in ifAdminStatus, but if ifAdminStatus is
changed over SNMP, this leaf is not affected.";
reference
"RFC 2863: The Interfaces Group MIB - ifAdminStatus";
}
}
grouping interface-phys-config {
description
"Configuration data for physical interfaces";
leaf type {
type identityref {
base ietf-if:interface-type;
}
mandatory true;
description
"[adapted from IETF interfaces model (RFC 7223)]
The type of the interface.
When an interface entry is created, a server MAY
initialize the type leaf with a valid value, e.g., if it
is possible to derive the type from the name of the
interface.
If a client tries to set the type of an interface to a
value that can never be used by the system, e.g., if the
type is not supported or if the type does not match the
name of the interface, the server MUST reject the request.
A NETCONF server MUST reply with an rpc-error with the
error-tag 'invalid-value' in this case.";
reference
"RFC 2863: The Interfaces Group MIB - ifType";
}
leaf mtu {
type uint16;
description
"Set the max transmission unit size in octets
for the physical interface. If this is not set, the mtu is
set to the operational default -- e.g., 1514 bytes on an
Ethernet interface.";
}
uses interface-common-config;
}
grouping interface-phys-holdtime-config {
description
"Configuration data for interface hold-time settings --
applies to physical interfaces.";
leaf up {
type uint32;
units milliseconds;
default 0;
description
"Dampens advertisement when the interface
transitions from down to up. A zero value means dampening
is turned off, i.e., immediate notification.";
}
leaf down {
type uint32;
units milliseconds;
default 0;
description
"Dampens advertisement when the interface transitions from
up to down. A zero value means dampening is turned off,
i.e., immediate notification.";
}
}
grouping interface-phys-holdtime-state {
description
"Operational state data for interface hold-time.";
}
grouping interface-phys-holdtime-top {
description
"Top-level grouping for setting link transition
dampening on physical and other types of interfaces.";
container hold-time {
description
"Top-level container for hold-time settings to enable
dampening advertisements of interface transitions.";
container config {
description
"Configuration data for interface hold-time settings.";
uses interface-phys-holdtime-config;
}
container state {
config false;
description
"Operational state data for interface hold-time.";
uses interface-phys-holdtime-config;
uses interface-phys-holdtime-state;
}
}
}
grouping interface-common-state {
description
"Operational state data (in addition to intended configuration)
at the global level for this interface";
leaf ifindex {
type uint32;
description
"System assigned number for each interface. Corresponds to
ifIndex object in SNMP Interface MIB";
reference
"RFC 2863 - The Interfaces Group MIB";
}
leaf admin-status {
type enumeration {
enum UP {
description
"Ready to pass packets.";
}
enum DOWN {
description
"Not ready to pass packets and not in some test mode.";
}
enum TESTING {
//TODO: This is generally not supported as a configured
//admin state, though it's in the standard interfaces MIB.
//Consider removing it.
description
"In some test mode.";
}
}
//TODO:consider converting to an identity to have the
//flexibility to remove some values defined by RFC 7223 that
//are not used or not implemented consistently.
mandatory true;
description
"[adapted from IETF interfaces model (RFC 7223)]
The desired state of the interface. In RFC 7223 this leaf
has the same read semantics as ifAdminStatus. Here, it
reflects the administrative state as set by enabling or
disabling the interface.";
reference
"RFC 2863: The Interfaces Group MIB - ifAdminStatus";
}
leaf oper-status {
type enumeration {
enum UP {
value 1;
description
"Ready to pass packets.";
}
enum DOWN {
value 2;
description
"The interface does not pass any packets.";
}
enum TESTING {
value 3;
description
"In some test mode. No operational packets can
be passed.";
}
enum UNKNOWN {
value 4;
description
"Status cannot be determined for some reason.";
}
enum DORMANT {
value 5;
description
"Waiting for some external event.";
}
enum NOT_PRESENT {
value 6;
description
"Some component (typically hardware) is missing.";
}
enum LOWER_LAYER_DOWN {
value 7;
description
"Down due to state of lower-layer interface(s).";
}
}
//TODO:consider converting to an identity to have the
//flexibility to remove some values defined by RFC 7223 that
//are not used or not implemented consistently.
mandatory true;
description
"[adapted from IETF interfaces model (RFC 7223)]
The current operational state of the interface.
This leaf has the same semantics as ifOperStatus.";
reference
"RFC 2863: The Interfaces Group MIB - ifOperStatus";
}
leaf last-change {
type yang:timeticks;
description
"Date and time of the last state change of the interface
(e.g., up-to-down transition). This corresponds to the
ifLastChange object in the standard interface MIB.";
reference
"RFC 2863: The Interfaces Group MIB - ifLastChange";
}
}
grouping interface-counters-state {
description
"Operational state representing interface counters
and statistics. Some of these are adapted from RFC 7223";
//TODO: we may need to break this list of counters into those
//that would appear for physical vs. subinterface or logical
//interfaces. For now, just replicating the full stats
//grouping to both interface and subinterface.
container counters {
description
"A collection of interface-related statistics objects.";
reference
"RFC 7223 - A YANG Data Model for Interface
Management";
leaf in-octets {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The total number of octets received on the interface,
including framing characters.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifHCInOctets";
}
leaf in-unicast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The number of packets, delivered by this sub-layer to a
higher (sub-)layer, that were not addressed to a
multicast or broadcast address at this sub-layer.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
}
leaf in-broadcast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The number of packets, delivered by this sub-layer to a
higher (sub-)layer, that were addressed to a broadcast
address at this sub-layer.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB -
ifHCInBroadcastPkts";
}
leaf in-multicast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The number of packets, delivered by this sub-layer to a
higher (sub-)layer, that were addressed to a multicast
address at this sub-layer. For a MAC-layer protocol,
this includes both Group and Functional addresses.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB -
ifHCInMulticastPkts";
}
leaf in-discards {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
The number of inbound packets that were chosen to be
discarded even though no errors had been detected to
prevent their being deliverable to a higher-layer
protocol. One possible reason for discarding such a
packet could be to free up buffer space.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifInDiscards";
}
leaf in-errors {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
For packet-oriented interfaces, the number of inbound
packets that contained errors preventing them from being
deliverable to a higher-layer protocol. For character-
oriented or fixed-length interfaces, the number of
inbound transmission units that contained errors
preventing them from being deliverable to a higher-layer
protocol.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifInErrors";
}
leaf in-unknown-protos {
type yang:counter32;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
For packet-oriented interfaces, the number of packets
received via the interface that were discarded because
of an unknown or unsupported protocol. For
character-oriented or fixed-length interfaces that
support protocol multiplexing, the number of
transmission units received via the interface that were
discarded because of an unknown or unsupported protocol.
For any interface that does not support protocol
multiplexing, this counter is not present.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
}
leaf out-octets {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
The total number of octets transmitted out of the
interface, including framing characters.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
}
leaf out-unicast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The total number of packets that higher-level protocols
requested be transmitted, and that were not addressed
to a multicast or broadcast address at this sub-layer,
including those that were discarded or not sent.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
}
leaf out-broadcast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
The total number of packets that higher-level protocols
requested be transmitted, and that were addressed to a
broadcast address at this sub-layer, including those
that were discarded or not sent.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB -
ifHCOutBroadcastPkts";
}
leaf out-multicast-pkts {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
The total number of packets that higher-level protocols
requested be transmitted, and that were addressed to a
multicast address at this sub-layer, including those
that were discarded or not sent. For a MAC-layer
protocol, this includes both Group and Functional
addresses.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB -
ifHCOutMulticastPkts";
}
leaf out-discards {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
The number of outbound packets that were chosen to be
discarded even though no errors had been detected to
prevent their being transmitted. One possible reason
for discarding such a packet could be to free up buffer
space.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifOutDiscards";
}
leaf out-errors {
type yang:counter64;
description
"[adapted from IETF interfaces model (RFC 7223)]
Changed the counter type to counter64.
For packet-oriented interfaces, the number of outbound
packets that could not be transmitted because of errors.
For character-oriented or fixed-length interfaces, the
number of outbound transmission units that could not be
transmitted because of errors.
Discontinuities in the value of this counter can occur
at re-initialization of the management system, and at
other times as indicated by the value of
'discontinuity-time'.";
reference
"RFC 2863: The Interfaces Group MIB - ifOutErrors";
}
leaf last-clear {
type yang:date-and-time;
description
"Indicates the last time the interface counters were
cleared.";
}
}
}
// data definition statements
grouping sub-unnumbered-config {
description
"Configuration data for unnumbered subinterfaces";
leaf enabled {
type boolean;
default false;
description
"Indicates that the subinterface is unnumbered. By default
the subinterface is numbered, i.e., expected to have an
IP address configuration.";
}
}
grouping sub-unnumbered-state {
description
"Operational state data unnumbered subinterfaces";
}
grouping sub-unnumbered-top {
description
"Top-level grouping unnumbered subinterfaces";
container unnumbered {
description
"Top-level container for setting unnumbered interfaces.
Includes reference the interface that provides the
address information";
container config {
description
"Configuration data for unnumbered interface";
uses sub-unnumbered-config;
}
container state {
config false;
description
"Operational state data for unnumbered interfaces";
uses sub-unnumbered-config;
uses sub-unnumbered-state;
}
uses oc-if:interface-ref;
}
}
grouping subinterfaces-config {
description
"Configuration data for subinterfaces";
leaf index {
type uint32;
default 0;
description
"The index of the subinterface, or logical interface number.
On systems with no support for subinterfaces, or not using
subinterfaces, this value should default to 0, i.e., the
default subinterface.";
}
uses interface-common-config;
}
grouping subinterfaces-state {
description
"Operational state data for subinterfaces";
uses interface-common-state;
uses interface-counters-state;
}
grouping subinterfaces-top {
description
"Subinterface data for logical interfaces associated with a
given interface";
container subinterfaces {
description
"Enclosing container for the list of subinterfaces associated
with a physical interface";
list subinterface {
key "index";
description
"The list of subinterfaces (logical interfaces) associated
with a physical interface";
leaf index {
type leafref {
path "../config/index";
}
description
"The index number of the subinterface -- used to address
the logical interface";
}
container config {
description
"Configurable items at the subinterface level";
uses subinterfaces-config;
}
container state {
config false;
description
"Operational state data for logical interfaces";
uses subinterfaces-config;
uses subinterfaces-state;
}
}
}
}
grouping interfaces-top {
description
"Top-level grouping for interface configuration and
operational state data";
container interfaces {
description
"Top level container for interfaces, including configuration
and state data.";
list interface {
key "name";
description
"The list of named interfaces on the device.";
leaf name {
type leafref {
path "../config/name";
}
description
"References the configured name of the interface";
//TODO: need to consider whether this should actually
//reference the name in the state subtree, which
//presumably would be the system-assigned name, or the
//configured name. Points to the config/name now
//because of YANG 1.0 limitation that the list
//key must have the same "config" as the list, and
//also can't point to a non-config node.
}
container config {
description
"Configurable items at the global, physical interface
level";
uses interface-phys-config;
}
container state {
config false;
description
"Operational state data at the global interface level";
uses interface-phys-config;
uses interface-common-state;
uses interface-counters-state;
}
uses interface-phys-holdtime-top;
uses subinterfaces-top;
}
}
}
uses interfaces-top;
}

View File

@ -0,0 +1,285 @@
module openconfig-optical-amplifier {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/optical-amplfier";
prefix "oc-opt-amp";
import openconfig-transport-line-common {
prefix oc-line-com;
revision-date "2016-03-31";
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// import tailf-common {prefix "tailf";}
// tailf:export netconf;
// tailf:export rest;
// 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.1.0";
revision "2016-03-31" {
description
"Initial public release";
reference "0.1.0";
}
revision "2015-12-11" {
description
"Initial revision";
reference "TBD";
}
// 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 output-power {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"Output optical power of the amplifier.";
}
}
grouping optical-amplifier-state {
description
"Operational state data for optical amplifiers";
leaf actual-gain {
type decimal64 {
fraction-digits 2;
range 0..max;
}
units dB;
description
"Actual gain applied by the amplifier.";
}
leaf actual-gain-tilt {
type decimal64 {
fraction-digits 2;
}
units dB;
description
"The actual gain tilt.";
}
leaf input-power {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"Input optical power of the amplifier.";
}
}
grouping optical-amplifier-top {
description
"Top-level grouping for optical amplifier data";
container optical-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;
}
}
uses oc-line-com:optical-osc-top;
}
}
// data definition statements
uses optical-amplifier-top;
}

View File

@ -0,0 +1,487 @@
module openconfig-platform-transceiver {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/platform/transceiver";
prefix "oc-transceiver";
// import some basic types
import openconfig-platform {
prefix oc-platform;
revision-date "2016-06-06";
}
import openconfig-interfaces {
prefix oc-if;
revision-date "2016-05-26";
}
import openconfig-transport-types {
prefix oc-opt-types;
revision-date "2016-12-22";
}
import openconfig-types {
prefix oc-types;
revision-date "2017-01-13";
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
import ietf-yang-types {
prefix yang;
}
// import tailf-common {prefix "tailf";}
// tailf:export netconf;
// tailf:export rest;
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines configuration and operational state data
for transceivers (i.e., pluggable optics). The module should be
used in conjunction with the platform model where other
physical entity data are represented.
In the platform model, a component of type=TRANSCEIVER is
expected to be a subcomponent of a PORT component. This
module defines a concrete schema for the associated data for
components with type=TRANSCEIVER.";
oc-ext:openconfig-version "0.2.0";
revision "2016-12-22" {
description
"Adds preconfiguration data and clarified units";
reference "0.2.0";
}
// identity statements
// typedef statements
// grouping statements
grouping optical-power-state {
description
"Reusable leaves related to optical power state -- these
are read-only state values. If avg/min/max statistics are
not supported, the target is expected to just supply the
instant value";
container output-power {
description
"The output optical power of this port in units of 0.01dBm.
If the port is an aggregate of multiple physical channels,
this attribute is the total power or sum of all channels.
Values include the instantaneous, average, minimum, and
maximum statistics. If avg/min/max statistics are not
supported, the target is expected to just supply the
instant value";
uses oc-types:avg-min-max-instant-stats-precision2-dBm;
}
container input-power {
description
"The input optical power of this port in units of 0.01dBm.
If the port is an aggregate of multiple physical channels,
this attribute is the total power or sum of all channels.
Values include the instantaneous, average, minimum, and
maximum statistics. If avg/min/max statistics are not
supported, the target is expected to 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. Values include the
instantaneous, average, minimum, and maximum statistics.
If avg/min/max statistics are not supported, the target is
expected to just supply the instant value";
uses oc-types:avg-min-max-instant-stats-precision2-mA;
}
}
grouping output-optical-frequency {
description
"Reusable leaves related to optical output power -- this is
typically configurable on line side and read-only on the
client-side";
leaf output-frequency {
type oc-opt-types:frequency-type;
description
"The frequency in MHz of the individual physical channel
(e.g. ITU C50 - 195.0THz and would be reported as
195,000,000 MHz in this model). This attribute is not
configurable on most client ports.";
}
}
grouping physical-channel-config {
description
"Configuration data for physical client channels";
leaf index {
type uint16 {
range 0..max;
}
description
"Index of the physical channnel or lane within a physical
client port";
}
leaf description {
type string;
description
"Text description for the client physical channel";
}
leaf tx-laser {
type boolean;
description
"Enable (true) or disable (false) the transmit label for the
channel";
}
leaf target-output-power {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"Target output optical power level of the optical channel,
expressed in increments of 0.01 dBm (decibel-milliwats)";
}
}
grouping physical-channel-state {
description
"Operational state data for client channels.";
uses output-optical-frequency;
uses optical-power-state;
}
grouping physical-channel-top {
description
"Top-level grouping for physical client channels";
container physical-channels {
description
"Enclosing container for client channels";
list channel {
key "index";
description
"List of client channels, keyed by index within a physical
client port. A physical port with a single channel would
have a single zero-indexed element";
leaf index {
type leafref {
path "../config/index";
}
description
"Reference to the index number of the channel";
}
container config {
description
"Configuration data for physical channels";
uses physical-channel-config;
}
container state {
config false;
description
"Operational state data for channels";
uses physical-channel-config;
uses physical-channel-state;
}
}
}
}
grouping port-transceiver-config {
description
"Configuration data for client port transceivers";
leaf enabled {
type boolean;
description
"Turns power on / off to the transceiver -- provides a means
to power on/off the transceiver (in the case of SFP, SFP+,
QSFP,...) or enable high-power mode (in the case of CFP,
CFP2, CFP4) and is optionally supported (device can choose to
always enable). True = power on / high power, False =
powered off";
}
leaf form-factor-preconf {
type identityref {
base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
}
description
"Indicates the type of optical transceiver used on this
port. If the client port is built into the device and not
pluggable, then non-pluggable is the corresponding state. If
a device port supports multiple form factors (e.g. QSFP28
and QSFP+, then the value of the transceiver installed shall
be reported. If no transceiver is present, then the value of
the highest rate form factor shall be reported
(QSFP28, for example).
The form factor is included in configuration data to allow
pre-configuring a device with the expected type of
transceiver ahead of deployment. The corresponding state
leaf should reflect the actual transceiver type plugged into
the system.";
}
leaf ethernet-pmd-preconf {
type identityref {
base oc-opt-types:ETHERNET_PMD_TYPE;
}
description
"The Ethernet PMD is a property of the optical transceiver
used on the port, indicating the type of physical connection.
It is included in configuration data to allow pre-configuring
a port/transceiver with the expected PMD. The actual PMD is
indicated by the ethernet-pmd state leaf.";
}
}
grouping port-transceiver-state {
description
"Operational state data for client port transceivers";
leaf present {
type enumeration {
enum PRESENT {
description
"Transceiver is present on the port";
}
enum NOT_PRESENT {
description
"Transceiver is not present on the port";
}
}
description
"Indicates whether a transceiver is present in
the specified client port.";
}
leaf form-factor {
type identityref {
base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
}
description
"Indicates the type of optical transceiver used on this
port. If the client port is built into the device and not
pluggable, then non-pluggable is the corresponding state. If
a device port supports multiple form factors (e.g. QSFP28
and QSFP+, then the value of the transceiver installed shall
be reported. If no transceiver is present, then the value of
the highest rate form factor shall be reported
(QSFP28, for example).";
}
leaf connector-type {
type identityref {
base oc-opt-types:FIBER_CONNECTOR_TYPE;
}
description
"Connector type used on this port";
}
leaf internal-temp {
// TODO: this should probably be removed if we add temperature
// as a top-level component property, i.e., transceiver temp
// should be reported there.
type int16 {
range -40..125;
}
description
"Internally measured temperature in degrees Celsius. MSA
valid range is between -40 and +125C. Accuracy shall be
better than +/- 3 degC over the whole temperature range.";
}
leaf vendor {
type string {
length 1..16;
}
description
"Full name of transceiver vendor. 16-octet field that
contains ASCII characters, left-aligned and padded on the
right with ASCII spaces (20h)";
}
leaf vendor-part {
type string {
length 1..16;
}
description
"Transceiver vendor's part number. 16-octet field that
contains ASCII characters, left-aligned and padded on the
right with ASCII spaces (20h). If part number is undefined,
all 16 octets = 0h";
}
leaf vendor-rev {
type string {
length 1..2;
}
description
"Transceiver vendor's revision number. 2-octet field that
contains ASCII characters, left-aligned and padded on the
right with ASCII spaces (20h)";
}
//TODO: these compliance code leaves should be active based on
//the type of port
leaf ethernet-pmd {
type identityref {
base oc-opt-types:ETHERNET_PMD_TYPE;
}
description
"Ethernet PMD (physical medium dependent sublayer) that the
transceiver supports. The SFF/QSFP MSAs have registers for
this and CFP MSA has similar.";
}
leaf sonet-sdh-compliance-code {
type identityref {
base oc-opt-types:SONET_APPLICATION_CODE;
}
description
"SONET/SDH application code supported by the port";
}
leaf otn-compliance-code {
type identityref {
base oc-opt-types:OTN_APPLICATION_CODE;
}
description
"OTN application code supported by the port";
}
leaf serial-no {
type string {
length 1..16;
}
description
"Transceiver serial number. 16-octet field that contains
ASCII characters, left-aligned and padded on the right with
ASCII spaces (20h). If part serial number is undefined, all
16 octets = 0h";
}
leaf date-code {
type yang:date-and-time;
description
"Representation of the transceiver date code, typically
stored as YYMMDD. The time portion of the value is
undefined and not intended to be read.";
}
leaf fault-condition {
type boolean;
description
"Indicates if a fault condition exists in the transceiver";
}
}
grouping port-transceiver-top {
description
"Top-level grouping for client port transceiver data";
container transceiver {
description
"Top-level container for client port transceiver data";
container config {
description
"Configuration data for client port transceivers";
uses port-transceiver-config;
}
container state {
config false;
description
"Operational state data for client port transceivers";
uses port-transceiver-config;
uses port-transceiver-state;
}
// physical channels are associated with a transceiver
// component
uses physical-channel-top;
}
}
// data definition statements
// augment statements
augment "/oc-platform:components/oc-platform:component" {
description
"Adding transceiver data to physical inventory";
uses port-transceiver-top {
when "current()/oc-platform:state/" +
"oc-platform:type = 'TRANSCEIVER'" {
description
"Augment is active when component is of type TRANSCEIVER";
}
}
}
augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
//TODO: add 'when' or other condition to make sure this
//leafref points to a component of type TRANSCEIVER.
description
"Adds a reference from the base interface to its corresponding
physical channels.";
leaf-list physical-channel {
type leafref {
path "/oc-platform:components/" +
"oc-platform:component[oc-platform:name=current()/../oc-platform:hardware-port]/" +
"oc-transceiver:transceiver/" +
"oc-transceiver:physical-channels/oc-transceiver:channel/" +
"oc-transceiver:index";
}
description
"For a channelized interface, list of references to the
physical channels (lanes) corresponding to the interface.";
}
}
// rpc statements
// notification statements
}

View File

@ -0,0 +1,123 @@
module openconfig-platform-types {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/platform-types";
prefix "oc-platform-types";
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines data types (e.g., YANG identities)
to support the OpenConfig component inventory model.";
oc-ext:openconfig-version "0.4.0";
revision "2016-06-06" {
description
"Public release";
reference "0.4.0";
}
// identity statements
identity OPENCONFIG_HARDWARE_COMPONENT {
description
"Base identity for hardware related components in a managed
device. Derived identities are partially based on contents
of the IANA Entity MIB.";
reference
"IANA Entity MIB and RFC 6933";
}
identity OPENCONFIG_SOFTWARE_COMPONENT {
description
"Base identity for software-related components in a managed
device";
}
// hardware types
identity CHASSIS {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Chassis component, typically with multiple slots / shelves";
}
identity BACKPLANE {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Backplane component for aggregating traffic, typically
contained in a chassis component";
}
identity POWER_SUPPLY {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Component that is supplying power to the device";
}
identity FAN {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Cooling fan, or could be some other heat-reduction component";
}
identity SENSOR {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Physical sensor, e.g., a temperature sensor in a chassis";
}
identity MODULE {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Replaceable hardware module, e.g., a daughtercard";
}
identity LINECARD {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Linecard component, typically inserted into a chassis slot";
}
identity PORT {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Physical port, e.g., for attaching pluggables and networking
cables";
}
identity TRANSCEIVER {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Pluggable module present in a port";
}
identity CPU {
base OPENCONFIG_HARDWARE_COMPONENT;
description
"Processing unit, e.g., a management processor";
}
identity OPERATING_SYSTEM {
base OPENCONFIG_SOFTWARE_COMPONENT;
description
"Operating system running on a component";
}
}

View File

@ -0,0 +1,358 @@
module openconfig-platform {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/platform";
prefix "oc-platform";
import openconfig-platform-types { prefix oc-platform-types; }
import openconfig-interfaces { prefix oc-if; }
import openconfig-extensions { prefix oc-ext; }
// import tailf-common {prefix "tailf";}
// tailf:export netconf;
// tailf:export rest;
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines a data model for representing a system
component inventory, which can include hardware or software
elements arranged in an arbitrary structure. The primary
relationship supported by the model is containment, e.g.,
components containing subcomponents.
It is expected that this model reflects every field replacable
unit on the device at a minimum (i.e., additional information
may be supplied about non-replacable components).
Every element in the inventory is termed a 'component' with each
component expected to have a unique name and type, and optionally
a unique system-assigned identifier and FRU number. The
uniqueness is guaranteed by the system within the device.
Components may have properties defined by the system that are
modeled as a list of key-value pairs. These may or may not be
user-configurable. The model provides a flag for the system
to optionally indicate which properties are user configurable.
Each component also has a list of 'subcomponents' which are
references to other components. Appearance in a list of
subcomponents indicates a containment relationship as described
above. For example, a linecard component may have a list of
references to port components that reside on the linecard.
This schema is generic to allow devices to express their own
platform-specific structure. It may be augmented by additional
component type-specific schemas that provide a common structure
for well-known component types. In these cases, the system is
expected to populate the common component schema, and may
optionally also represent the component and its properties in the
generic structure.
The properties for each component may include dynamic values,
e.g., in the 'state' part of the schema. For example, a CPU
component may report its utilization, temperature, or other
physical properties. The intent is to capture all platform-
specific physical data in one location, including inventory
(presence or absence of a component) and state (physical
attributes or status).";
oc-ext:openconfig-version "0.4.0";
revision "2016-06-06" {
description
"Public release";
reference "0.4.0";
}
// grouping statements
grouping platform-component-properties-config {
description
"System-defined configuration data for component properties";
leaf name {
type string;
description
"System-supplied name of the property -- this is typically
non-configurable";
}
leaf value {
type union {
type string;
type boolean;
type int64;
type uint64;
type decimal64 {
fraction-digits 2;
}
}
description
"Property values can take on a variety of types. Signed and
unsigned integer types may be provided in smaller sizes,
e.g., int8, uint16, etc.";
}
}
grouping platform-component-properties-state {
description
"Operational state data for component properties";
leaf configurable {
type boolean;
description
"Indication whether the property is user-configurable";
}
}
grouping platform-component-properties-top {
description
"Top-level grouping ";
container properties {
description
"Enclosing container ";
list property {
key "name";
description
"List of system properties for the component";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the property name.";
}
container config {
description
"Configuration data for each property";
uses platform-component-properties-config;
}
container state {
config false;
description
"Operational state data for each property";
uses platform-component-properties-config;
uses platform-component-properties-state;
}
}
}
}
grouping platform-subcomponent-ref-config {
description
"Configuration data for subcomponent references";
leaf name {
type leafref {
path "../../../../../component/config/name";
}
description
"Reference to the name of the subcomponent";
}
}
grouping platform-subcomponent-ref-state {
description
"Operational state data for subcomponent references";
}
grouping platform-subcomponent-ref-top {
description
"Top-level grouping for list of subcomponent references";
container subcomponents {
description
"Enclosing container for subcomponent references";
list subcomponent {
key "name";
description
"List of subcomponent references";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the name list key";
}
container config {
description
"Configuration data ";
uses platform-subcomponent-ref-config;
}
container state {
config false;
description
"Operational state data ";
uses platform-subcomponent-ref-config;
uses platform-subcomponent-ref-state;
}
}
}
}
grouping platform-component-config {
description
"Configuration data for components";
leaf name {
type string;
description
"Device name for the component -- this will not be a
configurable parameter on many implementations";
}
}
grouping platform-component-state {
description
"Operational state data for device components.";
leaf type {
type union {
type identityref {
base oc-platform-types:OPENCONFIG_HARDWARE_COMPONENT;
}
type identityref {
base oc-platform-types:OPENCONFIG_SOFTWARE_COMPONENT;
}
}
description
"Type of component as identified by the system";
}
leaf id {
type string;
description
"Unique identifier assigned by the system for the
component";
}
leaf description {
type string;
description
"System-supplied description of the component";
}
leaf mfg-name {
type string;
description
"System-supplied identifier for the manufacturer of the
component. This data is particularly useful when a
component manufacturer is different than the overall
device vendor.";
}
leaf version {
type string;
description
"System-defined version string for a hardware, firmware,
or software component.";
}
leaf serial-no {
type string;
description
"System-assigned serial number of the component.";
}
leaf part-no {
type string;
description
"System-assigned part number for the component. This should
be present in particular if the component is also an FRU
(field replacable unit)";
}
}
grouping platform-component-top {
description
"Top-level grouping for components in the device inventory";
container components {
description
"Enclosing container for the components in the system.";
list component {
key "name";
description
"List of components, keyed by component name.";
leaf name {
type leafref {
path "../config/name";
}
description
"References the component name";
}
container config {
description
"Configuration data for each component";
uses platform-component-config;
}
container state {
config false;
description
"Operational state data for each component";
uses platform-component-config;
uses platform-component-state;
}
uses platform-component-properties-top;
uses platform-subcomponent-ref-top;
}
}
}
// data definition statements
uses platform-component-top;
// augments
augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
//TODO: add 'when' or other condition to make sure this
//leafref points to a component of type PORT.
description
"Adds a reference from the base interface to the corresponding
port in the device inventory.";
leaf hardware-port {
type leafref {
path "/oc-platform:components/oc-platform:component/" +
"oc-platform:name";
}
description
"References the hardware port in the device inventory";
}
}
}

View File

@ -0,0 +1,233 @@
module openconfig-transport-line-common {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/transport-line-common";
prefix "oc-line-com";
// import some basic types
import openconfig-platform {
prefix oc-platform;
revision-date "2016-06-06";
}
import openconfig-platform-types {
prefix oc-platform-types;
revision-date "2016-06-06";
}
import openconfig-interfaces {
prefix oc-if;
revision-date "2016-05-26";
}
import iana-if-type {
prefix ift;
revision-date "2016-11-23";
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// import tailf-common {prefix "tailf";}
// tailf:export netconf;
// tailf:export rest;
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines common data elements for OpenConfig data
models for optical transport line system elements, such as
amplifiers and ROADMs (wavelength routers).";
oc-ext:openconfig-version "0.1.0";
revision "2016-03-31" {
description
"Initial public release";
reference "0.1.0";
}
// extension statements
// feature statements
// identity statements
identity OPTICAL_LINE_PORT_TYPE {
description
"Type definition for optical node port types";
}
identity INGRESS {
base OPTICAL_LINE_PORT_TYPE;
description
"Ingress port, corresponding to a signal entering
a line device such as an amplifier or wavelength
router.";
}
identity EGRESS {
base OPTICAL_LINE_PORT_TYPE;
description
"Egress port, corresponding to a signal exiting
a line device wavelength router.";
}
identity ADD {
base OPTICAL_LINE_PORT_TYPE;
description
"Add port, corresponding to a signal injected
at a wavelength router.";
}
identity DROP {
base OPTICAL_LINE_PORT_TYPE;
description
"Drop port, corresponding to a signal dropped
at a wavelength router.";
}
// typedef statements
// grouping statements
grouping optical-osc-config {
description
"Configuration data for OSC interfaces";
leaf-list interface {
type oc-if:base-interface-ref;
description
"List of references to OSC interfaces";
}
}
grouping optical-osc-state {
description
"Operational state data for OSC interfaces";
}
grouping optical-osc-top {
description
"Top-level grouping for configuration and operational state
data for optical supervisory channels (OSC) for amplifiers,
WSS/ROADM, nodes, etc.";
container supervisory-channels {
description
"Top-level container for OSC data";
container config {
description
"Configuration data for OSCs";
uses optical-osc-config;
}
container state {
config false;
description
"Operational state data for OSCs";
uses optical-osc-config;
uses optical-osc-state;
}
}
}
grouping transport-line-common-port-config {
description
"Configuration data for optical line ports";
}
grouping transport-line-common-port-state {
description
"Operational state data describing optical line ports";
leaf optical-port-type {
type identityref {
base OPTICAL_LINE_PORT_TYPE;
}
description
"Indicates the type of transport line port. This is an
informational field that should be made available by the
device (e.g., in the openconfig-platform model).";
}
}
grouping transport-line-common-port-top {
description
"Top-level grouping ";
container optical-port {
description
"Top-level container ";
container state {
config false;
description
"Operational state data for optical line ports";
uses transport-line-common-port-config;
uses transport-line-common-port-state;
}
}
}
// data definition statements
// uses optical-osc-top;
// augment statements
/*
augment "/oc-platform:components/oc-platform:component" {
description
"Adding optical line port data to platform model";
uses transport-line-common-port-top {
when "/oc-platform:components/oc-platform:component/" +
"oc-platform:state/oc-platform:type = 'oc-platform-types:PORT'" {
description
"Augment is active when component is of type
PORT";
}
}
}
*/
//TODO:this is placeholder until SONET model is added
//to interfaces model
/* augment "/oc-if:interfaces/oc-if:interface" {
when "oc-if:type = 'ift:sonet'" {
description "Additional interface configuration parameters when
the interface type is SONET/SDH";
}
description "Adds additional SONET/SDH-specific data to
osc model";
container sonet {
description
"Data related to SONET/SDH interfaces";
}
}
*/
// rpc statements
// notification statements
}

View File

@ -0,0 +1,765 @@
module openconfig-transport-types {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/transport-types";
prefix "oc-opt-types";
import openconfig-platform-types {
prefix oc-platform-types;
revision-date "2016-06-06";
}
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module contains general type definitions and identities
for optical transport models.";
oc-ext:openconfig-version "0.4.0";
revision "2016-12-22" {
description
"Fixes and additions for terminal optics model";
reference "0.4.0";
}
// typedef statements
typedef frequency-type {
type uint64;
units "MHz";
description
"Type for optical spectrum frequency values";
}
typedef admin-state-type {
type enumeration {
enum ENABLED {
description
"Sets the channel admin state to enabled";
}
enum DISABLED {
description
"Sets the channel admin state to disabled";
}
enum MAINT {
description
"Sets the channel to maintenance / diagnostic mode";
}
}
description "Administrative state modes for
logical channels in the transponder model.";
}
typedef loopback-mode-type {
type enumeration {
enum NONE {
description
"No loopback is applied";
}
enum FACILITY {
description
"A loopback which directs traffic normally transmitted
on the port back to the device as if received on the same
port from an external source.";
}
enum TERMINAL {
description
"A loopback which directs traffic received from an external
source on the port back out the transmit side of the same
port.";
}
}
default NONE;
description
"Loopback modes for transponder logical channels";
}
// grouping statements
grouping avg-min-max-instant-stats-precision2-ps-nm {
description
"Common grouping for recording picosecond per nanometer
values with 2 decimal precision. Values include the
instantaneous, average, minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units ps-nm;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units ps-nm;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units ps-nm;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units ps-nm;
description
"The maximum value of the statistic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision2-ps {
description
"Common grouping for recording picosecond values with
2 decimal precision. Values include the instantaneous,
average, minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units ps;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units ps;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units ps;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units ps;
description
"The maximum value of the statistic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision2-ps2 {
description
"Common grouping for recording picosecond^2 values with
2 decimal precision. Values include the instantaneous,
average, minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units ps^2;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units ps^2;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units ps^2;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units ps^2;
description
"The maximum value of the statistic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision18-ber {
description
"Common grouping for recording bit error rate (BER) values
with 18 decimal precision. Note that decimal64 supports
values as small as i x 10^-18 where i is an integer. Values
smaller than this should be reported as 0 to inidicate error
free or near error free performance. Values include the
instantaneous, average, minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 18;
}
units bit-errors-per-second;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 18;
}
units bit-errors-per-second;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 18;
}
units bit-errors-per-second;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 18;
}
units bit-errors-per-second;
description
"The maximum value of the statistic over the sampling
period";
}
}
// identity statements
identity TRIBUTARY_PROTOCOL_TYPE {
description
"Base identity for protocol framing used by tributary
signals.";
}
identity PROT_1GE {
base TRIBUTARY_PROTOCOL_TYPE;
description "1G Ethernet protocol";
}
identity PROT_OC48 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OC48 protocol";
}
identity PROT_STM16 {
base TRIBUTARY_PROTOCOL_TYPE;
description "STM 16 protocol";
}
identity PROT_10GE_LAN {
base TRIBUTARY_PROTOCOL_TYPE;
description "10G Ethernet LAN protocol";
}
identity PROT_10GE_WAN {
base TRIBUTARY_PROTOCOL_TYPE;
description "10G Ethernet WAN protocol";
}
identity PROT_OC192 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OC 192 (9.6GB) port protocol";
}
identity PROT_STM64 {
base TRIBUTARY_PROTOCOL_TYPE;
description "STM 64 protocol";
}
identity PROT_OTU2 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU 2 protocol";
}
identity PROT_OTU2E {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU 2e protocol";
}
identity PROT_OTU1E {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU 1e protocol";
}
identity PROT_ODU2 {
base TRIBUTARY_PROTOCOL_TYPE;
description "ODU 2 protocol";
}
identity PROT_ODU2E {
base TRIBUTARY_PROTOCOL_TYPE;
description "ODU 2e protocol";
}
identity PROT_40GE {
base TRIBUTARY_PROTOCOL_TYPE;
description "40G Ethernet port protocol";
}
identity PROT_OC768 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OC 768 protocol";
}
identity PROT_STM256 {
base TRIBUTARY_PROTOCOL_TYPE;
description "STM 256 protocol";
}
identity PROT_OTU3 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU 3 protocol";
}
identity PROT_ODU3 {
base TRIBUTARY_PROTOCOL_TYPE;
description "ODU 3 protocol";
}
identity PROT_100GE {
base TRIBUTARY_PROTOCOL_TYPE;
description "100G Ethernet protocol";
}
identity PROT_100G_MLG {
base TRIBUTARY_PROTOCOL_TYPE;
description "100G MLG protocol";
}
identity PROT_OTU4 {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU4 signal protocol (112G) for transporting
100GE signal";
}
identity PROT_OTUCN {
base TRIBUTARY_PROTOCOL_TYPE;
description "OTU Cn protocol";
}
identity PROT_ODU4 {
base TRIBUTARY_PROTOCOL_TYPE;
description "ODU 4 protocol";
}
identity TRANSCEIVER_FORM_FACTOR_TYPE {
description
"Base identity for identifying the type of pluggable optic
transceiver (i.e,. form factor) used in a port.";
}
identity CFP {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"C form-factor pluggable, that can support up to a
100 Gb/s signal with 10x10G or 4x25G physical channels";
}
identity CFP2 {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"1/2 C form-factor pluggable, that can support up to a
200 Gb/s signal with 10x10G, 4x25G, or 8x25G physical
channels";
}
identity CFP2_ACO {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"CFP2 analog coherent optics transceiver, supporting
100 Gb, 200Gb, and 250 Gb/s signal.";
}
identity CFP4 {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"1/4 C form-factor pluggable, that can support up to a
100 Gb/s signal with 10x10G or 4x25G physical channels";
}
identity QSFP {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"OriginalQuad Small Form-factor Pluggable transceiver that can
support 4x1G physical channels. Not commonly used.";
}
identity QSFP_PLUS {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Quad Small Form-factor Pluggable transceiver that can support
up to 4x10G physical channels.";
}
identity QSFP28 {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"QSFP pluggable optic with support for up to 4x28G physical
channels";
}
identity CPAK {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Cisco CPAK transceiver supporting 100 Gb/s.";
}
identity SFP {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Small form-factor pluggable transceiver supporting up to
10 Gb/s signal";
}
identity SFP_PLUS {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Enhanced small form-factor pluggable transceiver supporting
up to 16 Gb/s signals, including 10 GbE and OTU2";
}
identity XFP {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"10 Gigabit small form factor pluggable transceiver supporting
10 GbE and OTU2";
}
identity X2 {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"10 Gigabit small form factor pluggable transceiver supporting
10 GbE using a XAUI inerface and 4 data channels.";
}
identity NON_PLUGGABLE {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Represents a port that does not require a pluggable optic,
e.g., with on-board optics like COBO";
}
identity OTHER {
base TRANSCEIVER_FORM_FACTOR_TYPE;
description
"Represents a transceiver form factor not otherwise listed";
}
identity FIBER_CONNECTOR_TYPE {
description
"Type of optical fiber connector";
}
identity SC_CONNECTOR {
base FIBER_CONNECTOR_TYPE;
description
"SC type fiber connector";
}
identity LC_CONNECTOR {
base FIBER_CONNECTOR_TYPE;
description
"LC type fiber connector";
}
identity MPO_CONNECTOR {
base FIBER_CONNECTOR_TYPE;
description
"MPO (multi-fiber push-on/pull-off) type fiber connector
1x12 fibers";
}
identity ETHERNET_PMD_TYPE {
description
"Ethernet compliance codes (PMD) supported by transceivers";
}
identity ETH_10GBASE_LRM {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 10GBASE_LRM";
}
identity ETH_10GBASE_LR {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 10GBASE_LR";
}
identity ETH_10GBASE_ZR {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 10GBASE_ZR";
}
identity ETH_10GBASE_ER {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 10GBASE_ER";
}
identity ETH_10GBASE_SR {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 10GBASE_SR";
}
identity ETH_40GBASE_CR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 40GBASE_CR4";
}
identity ETH_40GBASE_SR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 40GBASE_SR4";
}
identity ETH_40GBASE_LR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 40GBASE_LR4";
}
identity ETH_40GBASE_ER4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 40GBASE_ER4";
}
identity ETH_40GBASE_PSM4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 40GBASE_PSM4";
}
identity ETH_4X10GBASE_LR {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 4x10GBASE_LR";
}
identity ETH_4X10GBASE_SR {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 4x10GBASE_SR";
}
identity ETH_100G_AOC {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100G_AOC";
}
identity ETH_100G_ACC {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100G_ACC";
}
identity ETH_100GBASE_SR10 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_SR10";
}
identity ETH_100GBASE_SR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_SR4";
}
identity ETH_100GBASE_LR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_LR4";
}
identity ETH_100GBASE_ER4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_ER4";
}
identity ETH_100GBASE_CWDM4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_CWDM4";
}
identity ETH_100GBASE_CLR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_CLR4";
}
identity ETH_100GBASE_PSM4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_PSM4";
}
identity ETH_100GBASE_CR4 {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: 100GBASE_CR4";
}
identity ETH_UNDEFINED {
base ETHERNET_PMD_TYPE;
description "Ethernet compliance code: undefined";
}
identity SONET_APPLICATION_CODE {
description
"Supported SONET/SDH application codes";
}
identity VSR2000_3R2 {
base SONET_APPLICATION_CODE;
description
"SONET/SDH application code: VSR2000_3R2";
}
identity VSR2000_3R3 {
base SONET_APPLICATION_CODE;
description
"SONET/SDH application code: VSR2000_3R3";
}
identity VSR2000_3R5 {
base SONET_APPLICATION_CODE;
description
"SONET/SDH application code: VSR2000_3R5";
}
identity SONET_UNDEFINED {
base SONET_APPLICATION_CODE;
description
"SONET/SDH application code: undefined";
}
identity OTN_APPLICATION_CODE {
description
"Supported OTN application codes";
}
identity P1L1_2D1 {
base OTN_APPLICATION_CODE;
description
"OTN application code: P1L1_2D1";
}
identity P1S1_2D2 {
base OTN_APPLICATION_CODE;
description
"OTN application code: P1S1_2D2";
}
identity P1L1_2D2 {
base OTN_APPLICATION_CODE;
description
"OTN application code: P1L1_2D2";
}
identity OTN_UNDEFINED {
base OTN_APPLICATION_CODE;
description
"OTN application code: undefined";
}
identity TRIBUTARY_RATE_CLASS_TYPE {
description
"Rate of tributary signal _- identities will typically reflect
rounded bit rate.";
}
identity TRIB_RATE_1G {
base TRIBUTARY_RATE_CLASS_TYPE;
description
"1G tributary signal rate";
}
identity TRIB_RATE_2.5G {
base TRIBUTARY_RATE_CLASS_TYPE;
description
"2.5G tributary signal rate";
}
identity TRIB_RATE_10G {
base TRIBUTARY_RATE_CLASS_TYPE;
description
"10G tributary signal rate";
}
identity TRIB_RATE_40G {
base TRIBUTARY_RATE_CLASS_TYPE;
description
"40G tributary signal rate";
}
identity TRIB_RATE_100G {
base TRIBUTARY_RATE_CLASS_TYPE;
description
"100G tributary signal rate";
}
identity LOGICAL_ELEMENT_PROTOCOL_TYPE {
description
"Type of protocol framing used on the logical channel or
tributary";
}
identity PROT_ETHERNET {
base LOGICAL_ELEMENT_PROTOCOL_TYPE;
description
"Ethernet protocol framing";
}
identity PROT_OTN {
base LOGICAL_ELEMENT_PROTOCOL_TYPE;
description
"OTN protocol framing";
}
identity OPTICAL_CHANNEL {
base oc-platform-types:OPENCONFIG_HARDWARE_COMPONENT;
description
"Optical channels act as carriers for transport traffic
directed over a line system. They are represented as
physical components in the physical inventory model.";
}
}

View File

@ -0,0 +1,328 @@
module openconfig-types {
yang-version "1";
namespace "http://openconfig.net/yang/openconfig-types";
prefix "oc-types";
// import statements
import openconfig-extensions {
prefix oc-ext;
revision-date "2015-10-09";
}
// meta
organization
"OpenConfig working group";
contact
"OpenConfig working group
netopenconfig@googlegroups.com";
description
"This module contains a set of general type definitions that
are used across OpenConfig models. It can be imported by modules
that make use of these types.";
oc-ext:openconfig-version "0.3.2";
revision "2017-01-13" {
description
"Add ADDRESS_FAMILY identity";
reference "0.3.2";
}
revision "2016-11-14" {
description
"Correct length of ieeefloat32";
reference "0.3.1";
}
revision "2016-11-11" {
description
"Additional types - ieeefloat32 and routing-password";
reference "0.3.0";
}
revision "2016-05-31" {
description
"OpenConfig public release";
reference "0.2.0";
}
typedef percentage {
type uint8 {
range "0..100";
}
description
"Integer indicating a percentage value";
}
typedef std-regexp {
type string;
description
"This type definition is a placeholder for a standard
definition of a regular expression that can be utilised in
OpenConfig models. Further discussion is required to
consider the type of regular expressions that are to be
supported. An initial proposal is POSIX compatible.";
}
typedef timeticks64 {
type uint64;
description
"This type is based on the timeticks type defined in
RFC 6991, but with 64-bit width. It represents the time,
modulo 2^64, in hundredths of a second between two epochs.";
reference
"RFC 6991 - Common YANG Data Types";
}
typedef ieeefloat32 {
type binary {
length "32";
}
description
"An IEEE 32-bit floating point number. The format of this number
is of the form:
1-bit sign
8-bit exponent
24-bit fraction
The floating point value is calculated using:
(-1)**S * 2**(Exponent-127) * (1+Fraction)";
}
typedef routing-password {
type string;
description
"This type is indicative of a password that is used within
a routing protocol which can be returned in plain text to the
NMS by the local system. Such passwords are typically stored
as encrypted strings. Since the encryption used is generally
well known, it is possible to extract the original value from
the string - and hence this format is not considered secure.
Leaves specified with this type should not be modified by
the system, and should be returned to the end-user in plain
text. This type exists to differentiate passwords, which
may be sensitive, from other string leaves. It could, for
example, be used by the NMS to censor this data when
viewed by particular users.";
}
grouping avg-min-max-stats-precision1 {
description
"Common nodes for recording average, minimum, and
maximum values for a statistic. These values all have
fraction-digits set to 1.";
leaf avg {
type decimal64 {
fraction-digits 1;
}
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 1;
}
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 1;
}
description
"The maximum value of the statitic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision1 {
description
"Common grouping for recording an instantaneous statistic value
in addition to avg-min-max stats";
leaf instant {
type decimal64 {
fraction-digits 1;
}
description
"The instantaneous value of the statistic.";
}
uses avg-min-max-stats-precision1;
}
grouping avg-min-max-instant-stats-precision2-dB {
description
"Common grouping for recording dB values with 2 decimal
precision. Values include the instantaneous, average,
minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units dB;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units dB;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units dB;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units dB;
description
"The maximum value of the statistic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision2-dBm {
description
"Common grouping for recording dBm values with 2 decimal
precision. Values include the instantaneous, average,
minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The maximum value of the statistic over the sampling
period";
}
}
grouping avg-min-max-instant-stats-precision2-mA {
description
"Common grouping for recording mA values with 2 decimal
precision. Values include the instantaneous, average,
minimum, and maximum statistics";
leaf instant {
type decimal64 {
fraction-digits 2;
}
units mA;
description
"The instantaneous value of the statistic.";
}
leaf avg {
type decimal64 {
fraction-digits 2;
}
units mA;
description
"The arithmetic mean value of the statistic over the
sampling period.";
}
leaf min {
type decimal64 {
fraction-digits 2;
}
units mA;
description
"The minimum value of the statistic over the sampling
period";
}
leaf max {
type decimal64 {
fraction-digits 2;
}
units mA;
description
"The maximum value of the statistic over the sampling
period";
}
}
identity ADDRESS_FAMILY {
description
"A base identity for all address families";
}
identity IPV4 {
base ADDRESS_FAMILY;
description
"The IPv4 address family";
}
identity IPV6 {
base ADDRESS_FAMILY;
description
"The IPv6 address family";
}
identity MPLS {
base ADDRESS_FAMILY;
description
"The MPLS address family";
}
identity L2_ETHERNET {
base ADDRESS_FAMILY;
description
"The 802.3 Ethernet address family";
}
}

View File

@ -34,6 +34,7 @@
<module>common</module>
<module>microsemi</module>
<module>openconfig</module>
<module>openconfig-infinera</module>
<module>openroadm</module>
<module>l3vpn</module>
<module>tapi</module>

View File

@ -265,6 +265,7 @@ MODELS = [
'//models/common:onos-models-common-oar',
'//models/huawei:onos-models-huawei-oar',
'//models/openconfig:onos-models-openconfig-oar',
'//models/openconfig-infinera:onos-models-openconfig-infinera-oar',
'//models/openroadm:onos-models-openroadm-oar',
'//models/tapi:onos-models-tapi-oar',
'//models/l3vpn:onos-models-l3vpn-oar',