554368c7ecbe9f04a75b6adeec4450405cb6b249
[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.api
17
18 interface NetconfRpcService {
19
20     /**
21      * Lock
22      * @param messageId message id of the request.
23      * @param configTarget datastore ( running or candidate)
24      * @param messageTimeout message timeout of the request.
25      * @return Device response
26      */
27     fun lock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
28
29     /**
30      * Get-config
31      * @param messageId message id of the request.
32      * @param filter filter content.
33      * @param configTarget config target ( running or candidate)
34      * @param messageTimeout message timeout of the request.
35      * @return Device response
36      */
37     fun getConfig(messageId: String, filter: String, configTarget: String, messageTimeout: Int): DeviceResponse
38
39     /**
40      * Delete config from datastore
41      * @param messageId message id of the request.
42      * @param configTarget config target ( running or candidate)
43      * @param messageTimeout message timeout of the request.
44      * @return Device response
45      */
46     fun deleteConfig(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
47
48     /**
49      * Edit-config
50      * @param messageId message id of the request.
51      * @param messageContent edit config content.
52      * @param lock lock the device before performing edit.
53      * @param configTarget config target ( running or candidate)
54      * @param editDefaultOperation edit default operation (merge | replace | create | delete | remove or
55      * delete)
56      * @param clearCandidate commit after edit config
57      * @param commit clear candiate store before edit
58      * @param discardChanges Rollback on failure
59      * @param validate validate the config before commit
60      * @param unlock unlock device after edit
61      * @param messageTimeout message timeout of the request.
62      * @return Device response
63      */
64     fun editConfig(messageId: String, messageContent: String, lock: Boolean, configTarget: String,
65                    editDefaultOperation: String, deleteConfig: Boolean, validate: Boolean, commit: Boolean,
66                    discardChanges: Boolean, unlock: Boolean, messageTimeout: Int): DeviceResponse
67
68     /**
69      * Validate
70      * @param messageId message id of the request.
71      * @param configTarget config target ( running or candidate)
72      * @param messageTimeout message timeout of the request.
73      * @return Device response
74      */
75     fun validate(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
76
77     /**
78      * Commit
79      * @param messageId message id of the request.
80      * @param discardChanges Rollback on failure
81      * @param messageTimeout message timeout of the request.
82      * @return Device response
83      */
84     fun commit(messageId: String, discardChanges: Boolean, messageTimeout: Int): DeviceResponse
85
86     /**
87      * Unlock
88      * @param messageId message id of the request.
89      * @param configTarget config target ( running or candidate)
90      * @param messageTimeout message timeout of the request.
91      * @return Device response
92      */
93     fun unLock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
94
95     /**
96      * Discard config
97      * @param messageId message id of the request.
98      * @param messageTimeout message timeout of the request.
99      * @return Device response
100      */
101     fun discardConfig(messageId: String, messageTimeout: Int): DeviceResponse
102
103     /**
104      * Close session
105      * @param messageId message id of the request.
106      * @param force force closeSession
107      * @param messageTimeout message timeout of the request.
108      * @return Device response
109      */
110     fun closeSession(messageId: String, force: Boolean, messageTimeout: Int): DeviceResponse
111
112     /**
113      * Executes an RPC request to the netconf server.
114      *
115      * @param request the XML containing the RPC request for the server.
116      * @param messageId message id of the request.
117      * @param messageTimeout message timeout of the request.
118      * @return Device response
119      */
120     fun asyncRpc(request: String, messageId: String, messageTimeout: Int): DeviceResponse
121 }