2 * Copyright © 2017-2018 AT&T Intellectual Property.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.interfaces
18 import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.data.DeviceResponse
20 interface NetconfRpcClientService {
23 * @param deviceProperties deviceProperties
24 * @return NetconfSession
26 fun connect(deviceInfo: DeviceInfo): NetconfSession
35 * @param messageId message id of the request.
36 * @param configTarget config target ( running or candidate)
37 * @param messageTimeout message timeout of the request.
38 * @return Device response
40 fun lock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
43 * @param messageId message id of the request.
44 * @param messageContent filter content.
45 * @param configTarget config target ( running or candidate)
46 * @param messageTimeout message timeout of the request.
47 * @return Device response
49 fun getConfig(messageId: String, messageContent: String, configTarget: String, messageTimeout: Int): DeviceResponse
52 * @param messageId message id of the request.
53 * @param configTarget config target ( running or candidate)
54 * @param messageTimeout message timeout of the request.
55 * @return Device response
57 fun deleteConfig(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
60 * @param messageId message id of the request.
61 * @param messageContent edit config content.
62 * @param reConnect reconnect session
63 * @param wait waiting time to perform operation ( 0 indicates no wait )
64 * @param lock lock the device before performing edit.
65 * @param configTarget config target ( running or candidate)
66 * @param editDefaultOperation edit default operation (merge | replace | create | delete | remove or
68 * @param clearCandidate commit after edit config
69 * @param commit clear candiate store before edit
70 * @param discardChanges Rollback on failure
71 * @param validate validate the config before commit
72 * @param unlock unlock device after edit
73 * @param preRestartWait
74 * @param postRestartWait
75 * @param messageTimeout message timeout of the request.
76 * @return Device response
78 fun editConfig(messageId: String, messageContent: String, reConnect: Boolean, wait: Int, lock: Boolean,
79 configTarget: String, editDefaultOperation: String, clearCandidate: Boolean, validate: Boolean, commit: Boolean,
80 discardChanges: Boolean, unlock: Boolean, preRestartWait: Int, postRestartWait: Int, messageTimeout: Int): DeviceResponse
83 * @param messageId message id of the request.
84 * @param configTarget config target ( running or candidate)
85 * @param messageTimeout message timeout of the request.
86 * @return Device response
88 fun validate(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
91 * @param messageId message id of the request.
92 * @param message optional commit message
93 * @param discardChanges Rollback on failure
94 * @param messageTimeout message timeout of the request.
95 * @return Device response
97 fun commit(messageId: String, message: String, discardChanges: Boolean, messageTimeout: Int): DeviceResponse
100 * @param messageId message id of the request.
101 * @param configTarget config target ( running or candidate)
102 * @param messageTimeout message timeout of the request.
103 * @return Device response
105 fun unLock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
108 * @param messageId message id of the request.
109 * @param messageTimeout message timeout of the request.
110 * @return Device response
112 fun discardConfig(messageId: String, messageTimeout: Int): DeviceResponse
115 * @param messageId message id of the request.
116 * @param force force close
117 * @param messageTimeout message timeout of the request.
118 * @return Device response
120 fun close(messageId: String, force: Boolean, messageTimeout: Int): DeviceResponse
123 * Executes an RPC request to the netconf server.
125 * @param request the XML containing the RPC request for the server.
126 * @param messageId message id of the request.
127 * @param messageTimeout message timeout of the request.
128 * @return Device response
130 fun asyncRpc(request: String, messageId: String, messageTimeout: Int): DeviceResponse