e2c9bf9005932507048e4e9fc454b72ca9c9c9f8
[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 import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.utils.ModifyAction
19 import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.utils.NetconfDatastore
20
21 interface NetconfRpcService {
22
23     /**
24      * Lock
25      *
26      * @param configTarget running or candidate, default candidate
27      * @return Device response
28      */
29     fun lock(configTarget: String = NetconfDatastore.CANDIDATE.datastore): DeviceResponse
30
31     /**
32      * Get-config
33      *
34      * @param filter filter content, default empty
35      * @param configTarget running or candidate, default running
36      * @return Device response
37      */
38     fun getConfig(filter: String = "", configTarget: String = NetconfDatastore.RUNNING.datastore): DeviceResponse
39
40     /**
41      * Delete config
42      *
43      * @param configTarget running or candidate, default candidate
44      * @return Device response
45      */
46     fun deleteConfig(configTarget: String = NetconfDatastore.CANDIDATE.datastore): DeviceResponse
47
48     /**
49      * Edit-config
50      *
51      * @param messageContent edit config content.
52      * @param configTarget running or candidate, default candidate
53      * @param editDefaultOperation, default set to none. Valid values: merge, replace, create, delete, none
54      * @return Device response
55      */
56     fun editConfig(messageContent: String, configTarget: String = NetconfDatastore.CANDIDATE.datastore,
57                    editDefaultOperation: String = ModifyAction.NONE.action): DeviceResponse
58
59     /**
60      * Validate
61      *
62      * @param configTarget running or candidate, default candidate
63      * @return Device response
64      */
65     fun validate(configTarget: String = NetconfDatastore.CANDIDATE.datastore): DeviceResponse
66
67     /**
68      * Commit
69      *
70      * @return Device response
71      */
72     fun commit(): DeviceResponse
73
74     /**
75      * Unlock
76      *
77      * @param configTarget running or candidate, default candidate
78      * @return Device response
79      */
80     fun unLock(configTarget: String = NetconfDatastore.CANDIDATE.datastore): DeviceResponse
81
82     /**
83      * Discard config
84      *
85      * @return Device response
86      */
87     fun discardConfig(): DeviceResponse
88
89     /**
90      * Close session
91      *
92      * @param force force closeSession
93      * @return Device response
94      */
95     fun closeSession(force: Boolean): DeviceResponse
96
97     /**
98      * Executes an RPC request to the netconf server.
99      *
100      * @param request the XML containing the RPC request for the server.
101      * @return Device response
102      */
103     fun asyncRpc(request: String, messageId: String): DeviceResponse
104 }