2 * Copyright © 2018 IBM.
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 @file:Suppress("unused") //TODO remove this line!
19 import com.fasterxml.jackson.databind.node.ObjectNode
20 import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ActionIdentifiers
21 import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.CommonHeader
22 import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
23 import org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.executor.RestconfComponentFunction
24 import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
25 import org.slf4j.LoggerFactory
27 open class EditConfigure : RestconfComponentFunction() {
29 val log = LoggerFactory.getLogger(EditConfigure::class.java)!!
31 override fun getName(): String {
32 return "EditConfigure"
35 override fun process(executionRequest: ExecutionServiceInput) {
36 //val webClientService = restClientService("odlparent")
37 TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
40 override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
41 TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
45 open class MountNEditConfigure : RestconfComponentFunction() {
47 val log = LoggerFactory.getLogger(MountNEditConfigure::class.java)!!
49 override fun getName(): String {
50 return "MountNEditConfigure"
53 override fun process(executionRequest: ExecutionServiceInput) {
54 val webClientService = restClientService("odlparent")
56 TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
59 override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
60 TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
67 * This is for used for Testing only
69 open class TestRestconfConfigure : RestconfComponentFunction() {
71 val log = LoggerFactory.getLogger(TestRestconfConfigure::class.java)!!
73 override fun getName(): String {
74 return "TestRestconfConfigure"
77 override fun process(executionRequest: ExecutionServiceInput) {
78 log.info("processing request..")
81 override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
82 log.info("recovering..")
88 println("zzzzzzzzzzzzz")
89 val x = MountNEditConfigure()
91 val executionServiceInput = ExecutionServiceInput().apply {
92 commonHeader = CommonHeader().apply {
95 actionIdentifiers = ActionIdentifiers().apply {
96 actionName = "activate"
98 payload = JacksonUtils.jsonNode("{}") as ObjectNode
100 x.process(executionServiceInput);