668fb552f1261c4ec4bcb0c8ca553f393dd8704f
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
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.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.interfaces
17
18 import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.data.DeviceResponse
19
20 interface NetconfRpcClientService {
21
22     /**
23      * @param deviceProperties deviceProperties
24      * @return NetconfSession
25      */
26     fun connect(deviceInfo: DeviceInfo): NetconfSession
27
28
29     fun disconnect()
30
31
32     fun reconnect()
33
34     /**
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
39      */
40     fun lock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
41
42     /**
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
48      */
49     fun getConfig(messageId: String, messageContent: String, configTarget: String, messageTimeout: Int): DeviceResponse
50
51     /**
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
56      */
57     fun deleteConfig(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
58
59     /**
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
67      * delete)
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
77      */
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
81
82     /**
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
87      */
88     fun validate(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
89
90     /**
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
96      */
97     fun commit(messageId: String, message: String, discardChanges: Boolean, messageTimeout: Int): DeviceResponse
98
99     /**
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
104      */
105     fun unLock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
106
107     /**
108      * @param messageId message id of the request.
109      * @param messageTimeout message timeout of the request.
110      * @return Device response
111      */
112     fun discardConfig(messageId: String, messageTimeout: Int): DeviceResponse
113
114     /**
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
119      */
120     fun close(messageId: String, force: Boolean, messageTimeout: Int): DeviceResponse
121
122     /**
123      * Executes an RPC request to the netconf server.
124      *
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
129      */
130     fun asyncRpc(request: String, messageId: String, messageTimeout: Int): DeviceResponse
131 }