Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.drivers.microsemi.yang; |
| 17 | |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 18 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdShort; |
| 19 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MdId; |
| 20 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId; |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 21 | import org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 22 | import org.onosproject.incubator.net.l2monitoring.soam.SoamId; |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 23 | import org.onosproject.netconf.DatastoreId; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 24 | import org.onosproject.netconf.NetconfException; |
| 25 | import org.onosproject.netconf.NetconfSession; |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 26 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfm; |
| 27 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfmOpParam; |
| 28 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.abortloopback.AbortLoopbackInput; |
| 29 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceInput; |
| 30 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceOutput; |
| 31 | import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitloopback.TransmitLoopbackInput; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 32 | |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 33 | import java.util.Optional; |
| 34 | |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 35 | /** |
| 36 | * Extension of mseaCfmService to include NETCONF sessions. |
| 37 | * |
| 38 | * This is manually extended and should be revised if the msea-cfm.yang, |
| 39 | * msea-soam-pm.yang or msea-soam-fm.yang files change |
| 40 | */ |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 41 | public interface MseaCfmNetconfService { |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 42 | |
| 43 | /** |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 44 | * Returns minimal set of attributes of MEP. |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 45 | * |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 46 | * @param mdId The name of the MD |
| 47 | * @param maId The name of the MA |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 48 | * @param mepId The ID of the MEP |
| 49 | * @param session An active NETCONF session |
| 50 | * @return mseaCfm |
| 51 | * @throws NetconfException if the session has any error |
| 52 | */ |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 53 | MseaCfm getMepEssentials(MdId mdId, MaIdShort maId, MepId mepId, |
| 54 | NetconfSession session) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 55 | |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 56 | /** |
| 57 | * Returns full set of attributes of MEP. |
| 58 | * This returns config and state attributes of all children of the MEP |
| 59 | * except for Delay Measurements and Loss Measurements - these have to be |
| 60 | * retrieved separately, because of their potential size |
| 61 | * @param mdId The name of the MD |
| 62 | * @param maId The name of the MA |
| 63 | * @param mepId The ID of the MEP |
| 64 | * @param session An active NETCONF session |
| 65 | * @return mseaCfm |
| 66 | * @throws NetconfException if the session has any error |
| 67 | */ |
| 68 | MseaCfm getMepFull(MdId mdId, MaIdShort maId, MepId mepId, |
| 69 | NetconfSession session) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 70 | |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 71 | |
| 72 | /** |
| 73 | * Returns set of all MepIds from one Md or Ma or all. |
| 74 | * |
| 75 | * @param mdIdOptional An MdId to filter by, or empty to select all |
| 76 | * @param maIdOptional An MaId to filter by, or empty to select all |
| 77 | * @param session An active NETCONF session |
| 78 | * @param targetDs one of running, candidate or startup |
| 79 | * @return mseaCfm |
| 80 | * @throws NetconfException if the session has any error |
| 81 | */ |
| 82 | MseaCfm getMepIds(Optional<MdId> mdIdOptional, Optional<MaIdShort> maIdOptional, |
| 83 | NetconfSession session, DatastoreId targetDs) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 84 | /** |
| 85 | * Returns attributes of DM. |
| 86 | * |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 87 | * @param mdId The name of the MD |
| 88 | * @param maId The name of the MA |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 89 | * @param mepId The ID of the MEP |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 90 | * @param dmId The Id of the Delay Measurement - if null then all DMs |
| 91 | * @param parts The parts of the DM to return |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 92 | * @param session An active NETCONF session |
| 93 | * @return mseaCfm |
| 94 | * @throws NetconfException if the session has any error |
| 95 | */ |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 96 | MseaCfm getSoamDm(MdId mdId, MaIdShort maId, MepId mepId, |
| 97 | SoamId dmId, DmEntryParts parts, NetconfSession session) |
| 98 | throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 99 | |
| 100 | /** |
| 101 | * Sets the value to attribute mseaCfm. |
| 102 | * |
| 103 | * @param mseaCfm value of mseaCfm |
| 104 | * @param session An active NETCONF session |
| 105 | * @param targetDs one of running, candidate or startup |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 106 | * @return Boolean to indicate success or failure |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 107 | * @throws NetconfException if the session has any error |
| 108 | */ |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 109 | boolean setMseaCfm(MseaCfmOpParam mseaCfm, NetconfSession session, |
| 110 | DatastoreId targetDs) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 111 | |
| 112 | /** |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 113 | * Deletes named Meps of mseaCfm. |
| 114 | * Expects to see a list of Meps |
| 115 | * |
| 116 | * @param mseaCfm value of mseaCfm |
| 117 | * @param session An active NETCONF session |
| 118 | * @param targetDs one of running, candidate or startup |
| 119 | * @return Boolean to indicate success or failure |
| 120 | * @throws NetconfException if the session has any error |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 121 | * @throws CfmConfigException if the Cfm config has any error |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 122 | */ |
| 123 | boolean deleteMseaMep(MseaCfmOpParam mseaCfm, NetconfSession session, |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 124 | DatastoreId targetDs) throws NetconfException, CfmConfigException; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 125 | |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 126 | /** |
| 127 | * Deletes named Ma of mseaCfm. |
| 128 | * Expects to see a list of Mas |
| 129 | * |
| 130 | * @param mseaCfm value of mseaCfm |
| 131 | * @param session An active NETCONF session |
| 132 | * @param targetDs one of running, candidate or startup |
| 133 | * @return Boolean to indicate success or failure |
| 134 | * @throws NetconfException if the session has any error |
| 135 | * @throws CfmConfigException if the Cfm config has any error |
| 136 | */ |
| 137 | boolean deleteMseaMa(MseaCfmOpParam mseaCfm, NetconfSession session, |
| 138 | DatastoreId targetDs) throws NetconfException, CfmConfigException; |
| 139 | |
| 140 | /** |
| 141 | * Deletes a remote Mep from an MA. |
| 142 | * Expects one or more RMeps |
| 143 | * |
| 144 | * @param mseaCfm value of mseaCfm |
| 145 | * @param session An active NETCONF session |
| 146 | * @param targetDs one of running, candidate or startup |
| 147 | * @return Boolean to indicate success or failure |
| 148 | * @throws NetconfException if the session has any error |
| 149 | * @throws CfmConfigException if the Cfm config has any error |
| 150 | */ |
| 151 | boolean deleteMseaMaRMep(MseaCfmOpParam mseaCfm, NetconfSession session, |
| 152 | DatastoreId targetDs) throws NetconfException, CfmConfigException; |
| 153 | |
| 154 | /** |
| 155 | * Deletes named Md of mseaCfm. |
| 156 | * Expects to see a list of Mds |
| 157 | * |
| 158 | * @param mseaCfm value of mseaCfm |
| 159 | * @param session An active NETCONF session |
| 160 | * @param targetDs one of running, candidate or startup |
| 161 | * @return Boolean to indicate success or failure |
| 162 | * @throws NetconfException if the session has any error |
| 163 | * @throws CfmConfigException if the Cfm config has any error |
| 164 | */ |
| 165 | boolean deleteMseaMd(MseaCfmOpParam mseaCfm, NetconfSession session, |
| 166 | DatastoreId targetDs) throws NetconfException, CfmConfigException; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 167 | |
| 168 | /** |
| 169 | * Deletes named delay measurements of mseaCfm. |
| 170 | * Expects to see a list of Delay Measurements |
| 171 | * |
| 172 | * @param mseaCfm value of mseaCfm |
| 173 | * @param session An active NETCONF session |
| 174 | * @param targetDs one of running, candidate or startup |
| 175 | * @return Boolean to indicate success or failure |
| 176 | * @throws NetconfException if the session has any error |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 177 | * @throws CfmConfigException if the Cfm config has any error |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 178 | */ |
| 179 | boolean deleteMseaCfmDm(MseaCfmOpParam mseaCfm, NetconfSession session, |
Sean Condon | 96b896d | 2017-12-11 12:44:29 -0800 | [diff] [blame] | 180 | DatastoreId targetDs) throws NetconfException, CfmConfigException; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 181 | |
| 182 | /** |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 183 | * Service interface of transmitLoopback. |
| 184 | * |
| 185 | * @param inputVar input of service interface transmitLoopback |
| 186 | * @param session An active NETCONF session |
| 187 | * @throws NetconfException if the session has any error |
| 188 | */ |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 189 | void transmitLoopback(TransmitLoopbackInput inputVar, |
| 190 | NetconfSession session) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 191 | |
| 192 | /** |
| 193 | * Service interface of abortLoopback. |
| 194 | * |
| 195 | * @param inputVar input of service interface abortLoopback |
| 196 | * @param session An active NETCONF session |
| 197 | * @throws NetconfException if the session has any error |
| 198 | */ |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 199 | void abortLoopback(AbortLoopbackInput inputVar, |
| 200 | NetconfSession session) throws NetconfException; |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 201 | |
| 202 | /** |
| 203 | * Service interface of transmitLinktrace. |
| 204 | * |
| 205 | * @param inputVar input of service interface transmitLinktrace |
| 206 | * @param session An active NETCONF session |
| 207 | * @return transmitLinktraceOutput output of service interface transmitLinktrace |
| 208 | * @throws NetconfException if the session has any error |
| 209 | */ |
Sean Condon | 06613e9 | 2017-06-09 15:14:01 +0100 | [diff] [blame] | 210 | TransmitLinktraceOutput transmitLinktrace(TransmitLinktraceInput inputVar, |
| 211 | NetconfSession session) throws NetconfException; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 212 | |
| 213 | public enum DmEntryParts { |
| 214 | ALL_PARTS, |
| 215 | CURRENT_ONLY, |
| 216 | HISTORY_ONLY; |
| 217 | } |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 218 | } |