Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions models/yang/annotations/openconfig-platform-annot.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module openconfig-platform-annot {

yang-version "1";
namespace "http://openconfig.net/yang/platform-annot";
prefix "oc-platform-annot";

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

deviation /oc-platform:components/oc-platform:component {
deviate add {
sonic-ext:subtree-transformer "pfm_components_xfmr";
}
}
}
245 changes: 245 additions & 0 deletions models/yang/openconfig-platform-transceiver.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
module openconfig-platform-transceiver {

yang-version "1";

// namespace
namespace "http://openconfig.net/yang/platform/transceiver";

prefix "oc-transceiver";

import openconfig-transport-types { prefix oc-opt-types; }
import openconfig-alarm-types { prefix oc-alarm-types; }


grouping transceiver-threshold-top {
description
"Top-level grouping for transceiver alarm thresholds for
various sensors.";

container thresholds {
description
"Enclosing container for transceiver alarm thresholds.";

list threshold {
key "severity";
config false;
description
"List of transceiver alarm thresholds, indexed by
alarm severity.";

leaf severity {
type leafref {
path "../state/severity";
}
config false;
description
"The severity applied to the group of thresholds.
An implementation's highest severity threshold
should be mapped to OpenConfig's `CRITICAL`
severity level.";
}

container state {
config false;
description
"Operational alarm thresholds for the transceiver.";

uses transceiver-threshold-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.";
}
}

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).";
}
}

grouping transceiver-threshold-state {
description
"Grouping for all alarm threshold configs for a particular
severity level.";
leaf severity {
type identityref {
base oc-alarm-types:OPENCONFIG_ALARM_SEVERITY;
}
description
"The type of alarm to which the thresholds apply.";
}
leaf laser-temperature-upper {
type decimal64 {
fraction-digits 1;
}
units celsius;
description
"The upper temperature threshold for the laser temperature sensor.
This leaf value is compared to the instant value of
laser-temperature.";
}
leaf laser-temperature-lower {
type decimal64 {
fraction-digits 1;
}
units celsius;
description
"The lower temperature threshold for the laser temperature sensor.
This leaf value is compared to the instant value of
laser-temperature.";
}
leaf output-power-upper{
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The upper power threshold for the laser output power. This threshold
applies to every physical-channel on the transceiver and does not
apply to the aggregate transceiver optical-output-power. This leaf
value is compared to the instant value of optical-output-power.";
}
leaf output-power-lower{
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The lower power threshold for the laser output power. This threshold
applies to every physical-channel on the transceiver and does not
apply to the aggregate transceiver optical-output-power. This leaf
value is compared to the instant value of optical-output-power.";
}
leaf input-power-upper{
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The upper power threshold for the laser input power. This threshold
applies to every physical-channel on the transceiver and does not
apply to the aggregate transceiver optical-input-power. This leaf
value is compared to the instant value of optical-input-power.";
}
leaf input-power-lower{
type decimal64 {
fraction-digits 2;
}
units dBm;
description
"The lower power threshold for the laser input power. This threshold
applies to every physical-channel on the transceiver and does not
apply to the aggregate transceiver optical-input-power. This leaf
value is compared to the instant value of optical-input-power.";
}
leaf laser-bias-current-upper{
description
"The upper threshold for the laser bias current. This leaf value is
compared to the instant value of last-bias-current.";
type decimal64 {
fraction-digits 2;
}
units mA;
}
leaf laser-bias-current-lower{
description
"The lower threshold for the laser bias current. This leaf value is
compared to the instant value of last-bias-current.";
type decimal64 {
fraction-digits 2;
}
units mA;
}
leaf module-temperature-lower {
type decimal64 {
fraction-digits 1;
}
units celsius;
description
"The lower temperature threshold for the transceiver module. This
leaf value is compared to the instant value of module-temperature.";
}
leaf module-temperature-upper {
type decimal64 {
fraction-digits 1;
}
units celsius;
description
"The upper temperature threshold for the transceiver module. This
leaf value is compared to the instant value of module-temperature.";
}
}

}






3 changes: 2 additions & 1 deletion translib/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ const (
SnmpDB // 7
ErrorDB // 8
EventDB // 9
ApplStateDB DBNum = 14 // 14
// All DBs added above this line, please ----
MaxDB // The Number of DBs
MaxDB DBNum = 15 // The Number of DBs
)

func (dbNo DBNum) String() string {
Expand Down
Loading