mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-04 19:56:49 +02:00
Update the polatis yang models
Change-Id: I11da7032b110238c52e27f5f26a36ef379685b0d
This commit is contained in:
parent
2d76a5f1a1
commit
bd0779f07c
@ -16,8 +16,8 @@
|
||||
|
||||
package org.onosproject.drivers.polatis.netconf;
|
||||
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.CrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.crossconnects.Pair;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.CrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.crossconnects.Pair;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
|
||||
@ -33,11 +33,11 @@ import org.onosproject.net.flow.criteria.PortCriterion;
|
||||
import org.onosproject.net.flow.instructions.Instruction;
|
||||
import org.onosproject.net.flow.instructions.Instructions;
|
||||
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.CrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.crossconnects.Pair;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.crossconnects.DefaultPair;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.DefaultCrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20170804.opticalswitch.PortFormat;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.CrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.crossconnects.Pair;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.crossconnects.DefaultPair;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.DefaultCrossConnects;
|
||||
import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.PortFormat;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,17 @@ module polatis-switch {
|
||||
|
||||
description "This module describes features that are specific to Polatis optical switches";
|
||||
|
||||
revision "2018-01-19" {
|
||||
description "1. Added support for session management and control. Removed the redundant leaf 'logged-in-users'.
|
||||
2. Removed the deprecated NOTIF_PORT from when conditions. Removed the deprecated
|
||||
'notif-port-status' leaf from 'notification-log'. ";
|
||||
}
|
||||
revision "2017-09-11" {
|
||||
description "1. Changed 'enable-notifications' to 'mask-notification' and made all notification enabled by default.
|
||||
'mask-notification' can be used to disable notifications.
|
||||
2. Removed RPC 'get_alarm_state' and provided an equivalent operational data 'system-alarms'.
|
||||
3. Removed RPC 'shutter-status' and provided an equivalent operational data 'shutter-status'. ";
|
||||
}
|
||||
revision "2017-05-30" {
|
||||
description "1. Added support for activity-log configuration and notifications.
|
||||
2. Added an RPC to get current system alarm
|
||||
@ -39,7 +50,7 @@ module polatis-switch {
|
||||
}
|
||||
revision "2016-02-17" {
|
||||
description "1. Added Polatis specific Variable Optical Attenuation (VOA) modes
|
||||
2. Changed the data type for power alarm hysteresis and defined the range.";
|
||||
2. Changed the data type for power alarm hysteresis and defined the range.";
|
||||
}
|
||||
revision "2015-09-14" {
|
||||
description "Initial revision.";
|
||||
@ -89,7 +100,7 @@ module polatis-switch {
|
||||
type decimal64 {
|
||||
fraction-digits 2;
|
||||
range "1..5";
|
||||
}
|
||||
}
|
||||
|
||||
default 1;
|
||||
|
||||
@ -135,16 +146,6 @@ module polatis-switch {
|
||||
be saved and switch will boot to last saved configuration. When the startup mode is MODE_VOLATILE
|
||||
the switch will not retain the given configuration through system reset.";
|
||||
}
|
||||
list logged-in-users {
|
||||
config false;
|
||||
key username;
|
||||
|
||||
leaf username {
|
||||
type opsw:namesFormat;
|
||||
}
|
||||
|
||||
description "Users that are currently logged into the system.";
|
||||
}
|
||||
}
|
||||
augment "/opsw:system-config/opsw:user" {
|
||||
leaf group {
|
||||
@ -153,6 +154,7 @@ module polatis-switch {
|
||||
enum "user";
|
||||
enum "view";
|
||||
}
|
||||
default "user";
|
||||
description "The permissions group to which user belongs.
|
||||
Users in 'admin' group can read and write every data defined for the switch. They can
|
||||
create, delete or edit users, change system-config data.
|
||||
@ -175,88 +177,83 @@ module polatis-switch {
|
||||
|
||||
typedef notification-types {
|
||||
type bits {
|
||||
bit NOTIF_NONE {
|
||||
position 0;
|
||||
description "No notification";
|
||||
}
|
||||
bit NOTIF_PORT_POWER {
|
||||
position 1;
|
||||
description "Issued when power readings are outside power-alarm thresholds.";
|
||||
position 0;
|
||||
description "Issued when power readings are below
|
||||
'/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
|
||||
'/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
|
||||
}
|
||||
bit NOTIF_PORT_POWER_WARN {
|
||||
position 2;
|
||||
description "Issued when power readings are outside power-warning thresholds.";
|
||||
position 1;
|
||||
description "Issued when power readings are below
|
||||
'/opsw:opm-alarm-config/opsw:signal-degrade-thresholds' and
|
||||
'/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
|
||||
}
|
||||
bit NOTIF_SYSTEM {
|
||||
position 5;
|
||||
description "Issued for an internal error";
|
||||
position 2;
|
||||
description "Issued for system warnings and errors.";
|
||||
}
|
||||
bit NOTIF_APS {
|
||||
position 7;
|
||||
description "Issued for aps events.";
|
||||
position 3;
|
||||
description "Issued for APS events.";
|
||||
}
|
||||
bit NOTIF_ACTIVITY {
|
||||
position 8;
|
||||
description "Issued for any configuration changes performed by users.";
|
||||
position 4;
|
||||
description "Issued for switch configuration changes performed
|
||||
by users if '/opsw:system-config/opsw:activity-log/opsw:logging-enabled'
|
||||
is true. The scope of the configuration setting reported can be
|
||||
controlled by the '/opsw:system-config/opsw:activity-log/opsw:log-filter'.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leaf enable-notifications {
|
||||
leaf mask-notification {
|
||||
type notification-types;
|
||||
|
||||
default NOTIF_NONE;
|
||||
|
||||
description "Decide which class of netconf notification to send.
|
||||
All notifications are disabled by default";
|
||||
description "Polatis switch sends the notifications on the notification stream 'Polatis'.
|
||||
The leaf can be set to mask individual notifications appearing on that stream. ";
|
||||
}
|
||||
|
||||
notification port-power-alarm {
|
||||
description "Sent when power reading moves outside the thresholds set.";
|
||||
description "Issued when power readings are below
|
||||
'/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
|
||||
'/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
|
||||
|
||||
leaf port-id {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-id";
|
||||
}
|
||||
type uint32;
|
||||
mandatory true;
|
||||
}
|
||||
leaf port-label {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-label";
|
||||
}
|
||||
type opsw:namesFormatNullable;
|
||||
description "Label of the notification port";
|
||||
}
|
||||
}
|
||||
notification port-power-clear {
|
||||
description "Sent when power reading returns within the thresholds set, including hysteresis.";
|
||||
description "Issued when power readings are restored above
|
||||
'/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
|
||||
'/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
|
||||
|
||||
leaf port-id {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-id";
|
||||
}
|
||||
type uint32;
|
||||
mandatory true;
|
||||
}
|
||||
leaf port-label {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-label";
|
||||
}
|
||||
type opsw:namesFormatNullable;
|
||||
description "Label of the notification port";
|
||||
}
|
||||
}
|
||||
notification port-power-warn-alarm {
|
||||
description "Sent when power reading moves outside the warning offsets to the thresholds set.";
|
||||
description "Issued when power readings are below
|
||||
'/opsw:opm-alarm-config/opsw:signal-degrade-thresholds' and
|
||||
'/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
|
||||
|
||||
leaf port-id {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-id";
|
||||
}
|
||||
type uint32;
|
||||
mandatory true;
|
||||
description "ID for the port causing this notification.";
|
||||
}
|
||||
leaf port-label {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-label";
|
||||
}
|
||||
description "Label of the notification port";
|
||||
type opsw:namesFormatNullable;
|
||||
description "Label of the notification port.";
|
||||
}
|
||||
}
|
||||
notification port-power-warn-clear {
|
||||
@ -264,49 +261,56 @@ module polatis-switch {
|
||||
including hysteresis.";
|
||||
|
||||
leaf port-id {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-id";
|
||||
}
|
||||
type uint32;
|
||||
mandatory true;
|
||||
description "ID for the port causing this notification.";
|
||||
}
|
||||
leaf port-label {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-label";
|
||||
}
|
||||
type opsw:namesFormatNullable;
|
||||
description "Label of the notification port";
|
||||
}
|
||||
}
|
||||
notification system-error {
|
||||
description "This notification is generated when switch encounters an unexpected error.";
|
||||
|
||||
description "These notifications are generated under many circumstances as described by the 'error-code' and 'message'.";
|
||||
leaf error-code {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
description "Description of the system error.";
|
||||
description "ID for the cause of the notification.";
|
||||
}
|
||||
leaf switch-status {
|
||||
type polatis-switch-status;
|
||||
mandatory true;
|
||||
description "Status of the switch after the system error which
|
||||
resulted in this notification";
|
||||
description "Status of the switch after this notification";
|
||||
}
|
||||
leaf message {
|
||||
type string;
|
||||
description "Message related to system error.";
|
||||
description "Use readable description of the cause of this notification.";
|
||||
}
|
||||
}
|
||||
notification activity-log-notification {
|
||||
description "Sent when a new entry appears in the activity log.";
|
||||
leaf notification-username { type string; }
|
||||
leaf notification-ip-address { type inet:ip-address; }
|
||||
leaf notification-protocol { type string; }
|
||||
leaf notification-activity { type string; }
|
||||
}
|
||||
description "This notification reports a configuration change in the switch.";
|
||||
|
||||
leaf notification-username {
|
||||
type string;
|
||||
description "User who has changed the configuration.";
|
||||
}
|
||||
leaf notification-ip-address {
|
||||
type inet:ip-address;
|
||||
description "IPv4 address from which the client made the configuration changes";
|
||||
}
|
||||
leaf notification-protocol {
|
||||
type string;
|
||||
description "The protocol used to change the configuration.";
|
||||
}
|
||||
leaf notification-activity {
|
||||
type string;
|
||||
description "This message describes the configuration change that was made";
|
||||
}
|
||||
}
|
||||
|
||||
container notification-log {
|
||||
config false;
|
||||
|
||||
description "The log contains all notifications ignoring the restrictions in 'mask-notification'.";
|
||||
list log {
|
||||
key notif-id;
|
||||
leaf notif-id {
|
||||
@ -319,7 +323,7 @@ module polatis-switch {
|
||||
}
|
||||
leaf notif-count {
|
||||
type uint32;
|
||||
description "The number of notifications of the same notif-id.";
|
||||
description "The number of notifications of the same 'notif-id'.";
|
||||
}
|
||||
leaf notif-time-first {
|
||||
type yang:date-and-time;
|
||||
@ -337,16 +341,11 @@ module polatis-switch {
|
||||
description "Useful textual representation of the notification cause.";
|
||||
}
|
||||
leaf notif-port {
|
||||
type leafref {
|
||||
path "/opsw:ports/opsw:port/opsw:port-id";
|
||||
}
|
||||
when "../notif-type = 'NOTIF_PORT_POWER' or " +
|
||||
"../notif-type = 'NOTIF_PORT_POWER_WARN' or " +
|
||||
"../notif-type = 'NOTIF_PORT'";
|
||||
}
|
||||
leaf notif-port-status {
|
||||
type opsw:PortStatus;
|
||||
when "../notif-type = 'NOTIF_PORT'";
|
||||
"../notif-type = 'NOTIF_PORT_POWER_WARN' ";
|
||||
|
||||
type uint32;
|
||||
description "The port that is affected by power alarm or power warning alarm.";
|
||||
}
|
||||
container notif-system {
|
||||
leaf error-code {
|
||||
@ -357,81 +356,8 @@ module polatis-switch {
|
||||
}
|
||||
when "../notif-type = 'NOTIF_SYSTEM'";
|
||||
}
|
||||
description "Contains the log of all the notifications generated by the switch.";
|
||||
}
|
||||
}
|
||||
|
||||
rpc shutter-config {
|
||||
input {
|
||||
leaf duration-on {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
|
||||
description "Set how long the shutter will switched on in ms";
|
||||
}
|
||||
leaf duration-off {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
|
||||
description "Set how long the shutter will be switched off in ms";
|
||||
}
|
||||
leaf cycles {
|
||||
type int32;
|
||||
|
||||
description "Set the specific number of cycles the repeating
|
||||
shutter operates for";
|
||||
}
|
||||
|
||||
list port-interval {
|
||||
key port-id;
|
||||
leaf port-id { type opsw:portFormat; }
|
||||
min-elements 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rpc shutter-status {
|
||||
output {
|
||||
list port-interval {
|
||||
key port-id;
|
||||
leaf port-id { type opsw:portFormat; }
|
||||
|
||||
leaf duration-on {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
|
||||
description "Get how long the shutter will be switched on in ms";
|
||||
}
|
||||
leaf duration-off {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
|
||||
description "Get how long the shutter will be switched off in ms";
|
||||
}
|
||||
|
||||
leaf cycles {
|
||||
type uint32;
|
||||
|
||||
description "Get the specific number of cycles the repeating
|
||||
shutter operates for";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
rpc shutter-operation {
|
||||
input {
|
||||
leaf operation-on {
|
||||
type boolean;
|
||||
mandatory true;
|
||||
|
||||
description "The leaf starts or stops the given mode for programmable shutters. It will
|
||||
continue until it is stopped. Double stops and double starts have no effect.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rpc clear-notification-ids {
|
||||
description "This clears named or all notifications from the log, don't provide any input, or empty list to remove all.";
|
||||
input {
|
||||
@ -443,37 +369,160 @@ module polatis-switch {
|
||||
}
|
||||
}
|
||||
}
|
||||
container system-alarms {
|
||||
config false;
|
||||
description "This returns the current active system alarms.";
|
||||
|
||||
rpc get-alarm-state {
|
||||
description "This returns the alarm states currently active.";
|
||||
output {
|
||||
list alarm-state {
|
||||
key alarm-index;
|
||||
leaf alarm-index {
|
||||
type uint32;
|
||||
description "This is simply a count to have a unique key in the list";
|
||||
}
|
||||
|
||||
leaf alarm-type {
|
||||
type notification-types;
|
||||
mandatory true;
|
||||
}
|
||||
leaf alarm-time {
|
||||
type yang:date-and-time;
|
||||
mandatory true;
|
||||
description "Time at which the first notification was generated.";
|
||||
}
|
||||
leaf alarm-message {
|
||||
type string;
|
||||
mandatory true;
|
||||
description "Useful textual representation of the alarm cause.";
|
||||
}
|
||||
leaf port-id {
|
||||
type uint32;
|
||||
description "Port id parsed out the alarm message, set to 0 if not simple.";
|
||||
}
|
||||
list alarm {
|
||||
key alarm-time;
|
||||
leaf alarm-time {
|
||||
type yang:date-and-time;
|
||||
description "Time at which the alarm occured.";
|
||||
}
|
||||
leaf alarm-type {
|
||||
type notification-types;
|
||||
description "Type of the alarm.";
|
||||
}
|
||||
leaf alarm-message {
|
||||
type string;
|
||||
mandatory true;
|
||||
description "Message that explains the reason for the alarm.";
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping shutter {
|
||||
description "If the shutter feature is available, a port can be
|
||||
configured to block the signal periodically - once, a fixed number of
|
||||
times or indefinitely.";
|
||||
leaf signal-block-time {
|
||||
type uint32 {
|
||||
range "10..10000";
|
||||
}
|
||||
description "Time in (ms) for which shutter will block the signal when activated.";
|
||||
}
|
||||
leaf signal-restore-time {
|
||||
type uint32 {
|
||||
range "500..30000";
|
||||
}
|
||||
description "Time in (ms) for which shutter will restore the signal when activated. If this parameter is not configured, the shutter blocks once.";
|
||||
}
|
||||
leaf cycles {
|
||||
type uint32;
|
||||
description "The specific number of cycles the repeating shutter operates.
|
||||
When the cycles is 0, the shutter is in activated state until it is
|
||||
deactivated. This parameter may only be configured if 'signal-restore-time' is configured.";
|
||||
}
|
||||
}
|
||||
rpc shutter-config {
|
||||
description "Configures the shutter parameters for a list of ports.";
|
||||
input {
|
||||
list port {
|
||||
key port-id;
|
||||
leaf port-id {
|
||||
type opsw:portFormat;
|
||||
description "ID for port to configure";
|
||||
}
|
||||
uses shutter {
|
||||
refine signal-block-time {
|
||||
mandatory true;
|
||||
}
|
||||
}
|
||||
min-elements 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
container shutter-status {
|
||||
description "Reports the shutter status for all ports that can be configured.";
|
||||
config false;
|
||||
list port {
|
||||
key port-id;
|
||||
leaf port-id {
|
||||
type opsw:portFormat;
|
||||
description "port Id to which the configuration belongs";
|
||||
}
|
||||
uses shutter;
|
||||
leaf status {
|
||||
type enumeration {
|
||||
enum SHUTTER_IDLE { value 1; }
|
||||
enum SHUTTER_SET { value 2; }
|
||||
enum SHUTTER_ACTIVE { value 3; }
|
||||
enum SHUTTER_PENDING { value 4; }
|
||||
}
|
||||
description "Current shutter status for this port";
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc shutter-operation {
|
||||
description "Activates or deactivates the pre-configured list of ports.";
|
||||
input {
|
||||
leaf activate {
|
||||
type boolean;
|
||||
mandatory true;
|
||||
}
|
||||
leaf-list port {
|
||||
type opsw:portFormat;
|
||||
min-elements 1;
|
||||
|
||||
description "List of IDs for ports to be activated or deactivated.";
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc add-group-cross-connect {
|
||||
description "Cross connects one 'group' to another 'group', if possible.";
|
||||
input {
|
||||
leaf group-name-from {
|
||||
type opsw:groupNamesFormat;
|
||||
mandatory true;
|
||||
}
|
||||
leaf group-name-to {
|
||||
type opsw:groupNamesFormat;
|
||||
mandatory true;
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc delete-group-cross-connect {
|
||||
description "Disconnects all ports of a 'group'.";
|
||||
input {
|
||||
leaf group-name {
|
||||
type opsw:groupNamesFormat;
|
||||
mandatory true;
|
||||
}
|
||||
}
|
||||
}
|
||||
container sessions {
|
||||
description "Shows the active user sessions.";
|
||||
list session {
|
||||
config false;
|
||||
key session-id;
|
||||
leaf session-id {
|
||||
type uint32;
|
||||
description "ID of the session";
|
||||
}
|
||||
leaf protocol-name {
|
||||
type string;
|
||||
description "The protocol interface used for this session.";
|
||||
}
|
||||
leaf protocol-port {
|
||||
type uint32;
|
||||
description "The port number to which the client connected; not used for RS232.";
|
||||
}
|
||||
leaf client-address {
|
||||
type inet:ip-address;
|
||||
description "IP address from which the client connected; not used for RS232.";
|
||||
}
|
||||
leaf user-name {
|
||||
type opsw:userNamesFormat;
|
||||
description "The name of the user logged in on the session.";
|
||||
}
|
||||
}
|
||||
}
|
||||
rpc disconnect-session {
|
||||
description "Allows an admin to end a user's session.";
|
||||
input {
|
||||
leaf session-id {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user