blob: cbe41ba27092740817c1e5500e336aedd3da3613 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Sean Condonfae8e662016-12-15 10:25:13 +00003 *
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 */
16package org.onosproject.drivers.microsemi.yang;
17
Sean Condon0e89bda2017-03-21 14:23:19 +000018import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdShort;
19import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MdId;
20import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
Sean Condon96b896d2017-12-11 12:44:29 -080021import org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException;
Sean Condon0e89bda2017-03-21 14:23:19 +000022import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
Sean Condon06613e92017-06-09 15:14:01 +010023import org.onosproject.netconf.DatastoreId;
Sean Condonfae8e662016-12-15 10:25:13 +000024import org.onosproject.netconf.NetconfException;
25import org.onosproject.netconf.NetconfSession;
Sean Condon06613e92017-06-09 15:14:01 +010026import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfm;
27import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfmOpParam;
28import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.abortloopback.AbortLoopbackInput;
29import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceInput;
30import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceOutput;
31import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitloopback.TransmitLoopbackInput;
Sean Condonfae8e662016-12-15 10:25:13 +000032
Sean Condon96b896d2017-12-11 12:44:29 -080033import java.util.Optional;
34
Sean Condonfae8e662016-12-15 10:25:13 +000035/**
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 Condon06613e92017-06-09 15:14:01 +010041public interface MseaCfmNetconfService {
Sean Condonfae8e662016-12-15 10:25:13 +000042
43 /**
Sean Condon0e89bda2017-03-21 14:23:19 +000044 * Returns minimal set of attributes of MEP.
Sean Condonfae8e662016-12-15 10:25:13 +000045 *
Sean Condon0e89bda2017-03-21 14:23:19 +000046 * @param mdId The name of the MD
47 * @param maId The name of the MA
Sean Condonfae8e662016-12-15 10:25:13 +000048 * @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 Condon0e89bda2017-03-21 14:23:19 +000053 MseaCfm getMepEssentials(MdId mdId, MaIdShort maId, MepId mepId,
54 NetconfSession session) throws NetconfException;
Sean Condonfae8e662016-12-15 10:25:13 +000055
Sean Condon0e89bda2017-03-21 14:23:19 +000056 /**
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 Condonfae8e662016-12-15 10:25:13 +000070
Sean Condon96b896d2017-12-11 12:44:29 -080071
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 Condonfae8e662016-12-15 10:25:13 +000084 /**
85 * Returns attributes of DM.
86 *
Sean Condon0e89bda2017-03-21 14:23:19 +000087 * @param mdId The name of the MD
88 * @param maId The name of the MA
Sean Condonfae8e662016-12-15 10:25:13 +000089 * @param mepId The ID of the MEP
Sean Condon0e89bda2017-03-21 14:23:19 +000090 * @param dmId The Id of the Delay Measurement - if null then all DMs
91 * @param parts The parts of the DM to return
Sean Condonfae8e662016-12-15 10:25:13 +000092 * @param session An active NETCONF session
93 * @return mseaCfm
94 * @throws NetconfException if the session has any error
95 */
Sean Condon0e89bda2017-03-21 14:23:19 +000096 MseaCfm getSoamDm(MdId mdId, MaIdShort maId, MepId mepId,
97 SoamId dmId, DmEntryParts parts, NetconfSession session)
98 throws NetconfException;
Sean Condonfae8e662016-12-15 10:25:13 +000099
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 Condon06613e92017-06-09 15:14:01 +0100106 * @return Boolean to indicate success or failure
Sean Condonfae8e662016-12-15 10:25:13 +0000107 * @throws NetconfException if the session has any error
108 */
Sean Condon06613e92017-06-09 15:14:01 +0100109 boolean setMseaCfm(MseaCfmOpParam mseaCfm, NetconfSession session,
110 DatastoreId targetDs) throws NetconfException;
Sean Condonfae8e662016-12-15 10:25:13 +0000111
112 /**
Sean Condon0e89bda2017-03-21 14:23:19 +0000113 * 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 Condon96b896d2017-12-11 12:44:29 -0800121 * @throws CfmConfigException if the Cfm config has any error
Sean Condon0e89bda2017-03-21 14:23:19 +0000122 */
123 boolean deleteMseaMep(MseaCfmOpParam mseaCfm, NetconfSession session,
Sean Condon96b896d2017-12-11 12:44:29 -0800124 DatastoreId targetDs) throws NetconfException, CfmConfigException;
Sean Condon0e89bda2017-03-21 14:23:19 +0000125
Sean Condon96b896d2017-12-11 12:44:29 -0800126 /**
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 Condon0e89bda2017-03-21 14:23:19 +0000167
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 Condon96b896d2017-12-11 12:44:29 -0800177 * @throws CfmConfigException if the Cfm config has any error
Sean Condon0e89bda2017-03-21 14:23:19 +0000178 */
179 boolean deleteMseaCfmDm(MseaCfmOpParam mseaCfm, NetconfSession session,
Sean Condon96b896d2017-12-11 12:44:29 -0800180 DatastoreId targetDs) throws NetconfException, CfmConfigException;
Sean Condon0e89bda2017-03-21 14:23:19 +0000181
182 /**
Sean Condonfae8e662016-12-15 10:25:13 +0000183 * 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 Condon06613e92017-06-09 15:14:01 +0100189 void transmitLoopback(TransmitLoopbackInput inputVar,
190 NetconfSession session) throws NetconfException;
Sean Condonfae8e662016-12-15 10:25:13 +0000191
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 Condon06613e92017-06-09 15:14:01 +0100199 void abortLoopback(AbortLoopbackInput inputVar,
200 NetconfSession session) throws NetconfException;
Sean Condonfae8e662016-12-15 10:25:13 +0000201
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 Condon06613e92017-06-09 15:14:01 +0100210 TransmitLinktraceOutput transmitLinktrace(TransmitLinktraceInput inputVar,
211 NetconfSession session) throws NetconfException;
Sean Condon0e89bda2017-03-21 14:23:19 +0000212
213 public enum DmEntryParts {
214 ALL_PARTS,
215 CURRENT_ONLY,
216 HISTORY_ONLY;
217 }
Sean Condonfae8e662016-12-15 10:25:13 +0000218}