From b9b731a8512851c890086a776f36df10ae893944 Mon Sep 17 00:00:00 2001 From: dongxiancun Date: Fri, 9 Aug 2019 18:59:05 +0800 Subject: [PATCH] =?UTF-8?q?Add=20aaa-12=20=E9=A9=B1=E5=8A=A8=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=B1=82=EF=BC=8Cyang=E5=AE=9A=E4=B9=89=20RCA?= =?UTF-8?q?=EF=BC=9A=20SOL=EF=BC=9A=20=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?dongxiancun=20=E6=A3=80=E8=A7=86=E4=BA=BA=EF=BC=9Adongxiancun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../driver-layer/adaptation-layer/pom.xml | 70 +++++++++++-------- .../src/main/yang/device-status.yang | 49 +++++++++++++ .../src/main/yang/tp-extension.yang | 64 +++++++++++++++++ 3 files changed, 155 insertions(+), 28 deletions(-) create mode 100644 ControlPlatform/driver-layer/adaptation-layer/src/main/yang/device-status.yang create mode 100644 ControlPlatform/driver-layer/adaptation-layer/src/main/yang/tp-extension.yang diff --git a/ControlPlatform/driver-layer/adaptation-layer/pom.xml b/ControlPlatform/driver-layer/adaptation-layer/pom.xml index b124185e2..e36835623 100644 --- a/ControlPlatform/driver-layer/adaptation-layer/pom.xml +++ b/ControlPlatform/driver-layer/adaptation-layer/pom.xml @@ -1,36 +1,50 @@ - + -This program and the accompanying materials are made available under the -terms of the Eclipse Public License v1.0 which accompanies this distribution, -and is available at http://www.eclipse.org/legal/epl-v10.html ---> - + 4.0.0 - 4.0.0 + + org.opendaylight.mdsal + binding-parent + 0.12.4 + + - - org.opendaylight.mdsal - binding-parent - 0.12.4 - - + com.cmcc.cmhi + adaptation-layer + 0.1.0 + + ODL :: com.cmcc.cmhi :: ${project.artifactId} + bundle - com.cmcc.cmhi - adaptation-layer - 0.1.0 - - ODL :: com.cmcc.cmhi :: ${project.artifactId} - bundle + + + + org.opendaylight.controller + mdsal-artifacts + 1.7.4 + import + pom + + + - - - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - + + + org.opendaylight.mdsal.model + ietf-inet-types-2013-07-15 + + + org.opendaylight.controller.model + model-topology + + diff --git a/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/device-status.yang b/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/device-status.yang new file mode 100644 index 000000000..cb435f002 --- /dev/null +++ b/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/device-status.yang @@ -0,0 +1,49 @@ +// Contents of "device-status" +module device-status { + namespace "urn:cmcc:cmhi:adaptation-layer:device-status"; + prefix "device-status"; + + import network-topology { prefix "topo"; revision-date "2013-10-21"; } + import yang-ext { prefix ext; } + + revision 2019-08-09 { + description "扩展CPU和内存状态信息"; + } + + grouping cpu-status { + container cpu-infos { + description "CPU的状态信息"; + leaf usage-rate { + type int16 { + range "0..100"; + } + } + } + } + + grouping mem-status { + container memory-infos { + description "内存的状态信息"; + leaf memory-total { + type int16 { + range "0..100"; + } + } + leaf usage-rate { + type int16 { + range "0..100"; + } + } + } + } + + augment "/topo:network-topology/topo:topology/topo:node" { + ext:augment-identifier "node-cpu"; + uses cpu-status; + } + + augment "/topo:network-topology/topo:topology/topo:node" { + ext:augment-identifier "node-memory"; + uses mem-status; + } +} diff --git a/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/tp-extension.yang b/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/tp-extension.yang new file mode 100644 index 000000000..21d774231 --- /dev/null +++ b/ControlPlatform/driver-layer/adaptation-layer/src/main/yang/tp-extension.yang @@ -0,0 +1,64 @@ +// Contents of "tp-extension" +module tp-extension { + namespace "urn:cmcc:cmhi:adaptation-layer:tp-extension"; + prefix "tp-extension"; + + import network-topology { prefix "topo"; revision-date "2013-10-21"; } + import ietf-inet-types { prefix "inet"; revision-date 2013-07-15; } + import yang-ext { prefix ext; } + + revision 2019-08-09 { + description "扩展端口的scheme"; + } + + grouping tp-status { + container tp-infos { + description "端口的状态信息"; + leaf tp-name { + type string; + } + leaf tp-phy-type { + type string ; + default "Ethernet"; + } + leaf tp-number { + type string ; + } + container tp-admin-status { + leaf admin-status { + type enumeration { + enum up; + enum down; + } + } + } + leaf mtu { + type int16 ; + default 1500; + } + leaf tx-rate { + type int16 ; + default "单位为Mbps"; + } + leaf rx-rate { + type int16 ; + default "单位为Mbps"; + } + list ip-address { + leaf ip { + description "IPv4 or IPv6 address"; + type inet:ip-address; + } + leaf prefix { + type inet:ip-prefix; + description "掩码,格式255.255.255.0"; + } + } + } + } + + augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" { + ext:augment-identifier "tp-ext"; + uses tp-status; + } +}