From fde2e409737360a2af16bf38d6ccb731bf2b6df3 Mon Sep 17 00:00:00 2001 From: Rodrigo Ottero Date: Thu, 28 Feb 2019 14:08:55 +0000 Subject: *WIP*: draft of a blueprint for configuring a PNF This is a still-in-development draft of a blueprint, intended to be used to configure PNFs. It has been put in review as requested, to make easier for the community to make comments on it. The design considers that a blueprint will be created for each possible PNF. In some files, there are questions about the structure or content. The- se questions are surrounded by HTML comment tags , even if the file itself is not HTML - the intent is just to clearly highlight the questions. All of them are preceded by the string "QUESTION", to facil- itate search. Change-Id: Ib3ed2afb80693429dc23b7ac73c5cbe49b3f5c9a Issue-ID: CCSDK-1107 Signed-off-by: Rodrigo Ottero --- .../Definitions/activation-blueprint.json | 228 +++++++++++++++++++++ .../Definitions/artifact_types.json | 28 +++ .../Definitions/data_types.json | 23 +++ .../Definitions/node_types.json | 168 +++++++++++++++ .../Definitions/policy_types.json | 3 + .../Definitions/relationship_types.json | 9 + .../Definitions/resources_definition_types.json | 16 ++ .../Plans/CONFIG_configAssign.xml | 19 ++ .../capability_restconf/Plans/CONFIG_configure.xml | 19 ++ .../Scripts/RestconfAssignConfig.kts | 1 + .../Scripts/RestconfConfigure.kts | 1 + .../capability_restconf/TOSCA-Metada/TOSCA.meta | 5 + .../Templates/config-assign-pnf-mapping.json | 16 ++ .../config-assign-restconf-configlet-template.vtl | 19 ++ .../Templates/configure-pnf-mapping.json | 38 ++++ .../configure-restconf-mount-template.vtl | 14 ++ .../configure-restconf-unmount-template.vtl | 1 + .../kotlin/scripts/InternalSimpleRestconf.cba.kts | 29 ++- 18 files changed, 635 insertions(+), 2 deletions(-) create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/activation-blueprint.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/artifact_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/data_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/node_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/policy_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/relationship_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/resources_definition_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configAssign.xml create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configure.xml create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfAssignConfig.kts create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfConfigure.kts create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/TOSCA-Metada/TOSCA.meta create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/activation-blueprint.json new file mode 100644 index 00000000..96ae88e5 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/activation-blueprint.json @@ -0,0 +1,228 @@ + +{ + "tosca_definitions_version" : "controller_blueprint_1_0_0", + "metadata" : { + "template_author" : "Rodrigo Ottero", + "author-email" : "rodrigo.ottero@est.tech", + "user-groups" : "ADMIN, OPERATION", + "template_name" : "pnf restconf", + "template_version" : "1.0.0", + "template_tags" : "pnf, restconf, config, configuration" + }, + "imports" : [ { + "file" : "Definitions/data_types.json" + }, { + "file" : "Definitions/relationship_types.json" + }, { + "file" : "Definitions/artifact_types.json" + }, { + "file" : "Definitions/node_types.json" + }, { + "file" : "Definitions/policy_types.json" + } ], + "topology_template" : { + "inputs" : { + "serviceInstanceId" : { + "required" : true, + "type" : "string" + }, + "identifier" : { + "required" : true, + "type" : "string" + } + }, + "workflows" : { + "config-assign" : { + "steps" : { + "activate-process" : { + "description" : "Create a configlet", + "target" : "config-assign-process", + "activities" : [ { + "call_operation" : "" + } ] + } + }, + "inputs" : { + "config-assign-properties" : { + "description" : "Dynamic PropertyDefinition for workflow(config-assign).", + "required" : true, + "type" : "dt-config-assign-properties" + } + } + }, + "configure" : { + "steps" : { + "activate-process" : { + "description" : "Send a configlet to the pnf", + "target" : "configure-process", + "activities" : [ { + "call_operation" : "" + } ] + } + }, + "inputs" : { + "configure-properties" : { + "description" : "Dynamic PropertyDefinition for workflow(configure).", + "required" : true, + "type" : "dt-configure-properties" + } + } + } + }, + "node_templates" : { + "config-assign-process" : { + "type" : "dg-generic", + "properties" : { + "content" : { + "get_artifact" : [ "SELF", "dg-config-assign-process" ] + }, + "dependency-node-templates" : [ "config-assign" ] + }, + "artifacts" : { + "dg-config-assign-process" : { + "type" : "artifact-directed-graph", + "file" : "Plans/CONFIG_configAssign.xml" + } + } + }, + "config-assign" : { + "type" : "component-restconf-executor", + "requirements" : { + "restconf-connection" : { + "capability" : "restconf", + "node" : "sample-restconf-server", + "relationship" : "tosca.relationships.ConnectsTo" + } + }, + "interfaces" : { + "ComponentRestconfExecutor" : { + "operations" : { + "process" : { + "implementation" : { + "primary" : "component-script" + }, + "inputs" : { + "script-type" : "kotlin", + "script-class-reference" : "Scripts/kotlin/RestconfAssignConfig.kts", + "instance-dependencies" : [ ], + "artifact-prefix-names": [ + "config-assign" + ] + }, + "outputs" : { + "response-data" : "", + "status" : "" + } + } + } + } + }, + "artifacts" : { + "config-assign-template" : { + "type" : "artifact-template-velocity", + "file" : "Templates/config-assign-restconf-configlet-template.vtl" + }, + "config-assign-mapping" : { + "type" : "artifact-mapping-resource", + "file" : "Templates/config-assign-pnf-mapping.json" + }, + "component-script" : { + "type" : "artifact-script-kotlin", + "file" : "Scripts/kotlin/RestconfAssignConfig.py" + } + } + }, + "configure-process" : { + "type" : "dg-generic", + "properties" : { + "content" : { + "get_artifact" : [ "SELF", "dg-configure-process" ] + }, + "dependency-node-templates" : [ "configure" ] + }, + "artifacts" : { + "dg-config-assign-process" : { + "type" : "artifact-directed-graph", + "file" : "Plans/CONFIG_configure.xml" + } + } + }, + "configure" : { + "type" : "component-restconf-executor", + "requirements" : { + "restconf-connection" : { + "capability" : "restconf", + "node" : "sample-restconf-server", + "relationship" : "tosca.relationships.ConnectsTo" + } + }, + "interfaces" : { + "ComponentRestconfExecutor" : { + "operations" : { + "process" : { + "implementation" : { + "primary" : "component-script" + }, + "inputs" : { + "script-type" : "kotlin", + "script-class-reference" : "Scripts/kotlin/RestconfConfigure.kts", + "instance-dependencies" : [ ], + "artifact-prefix-names": [ + "configure-restconf-mount", "configure-restconf-unmount" + ] + }, + "outputs" : { + "response-data" : "", + "status" : "" + } + } + } + } + }, + "artifacts" : { + "configure-mount-template" : { + "type" : "artifact-template-velocity", + "file" : "Templates/configure-restconf-mount-template.vtl" + }, + "configure-unmount-template" : { + "type" : "artifact-template-velocity", + "file" : "Templates/configure-restconf-unmount-template.vtl" + }, + "configure-mapping" : { + "type" : "artifact-mapping-resource", + "file" : "Templates/configure-pnf-mapping.json" + }, + "component-script" : { + "type" : "artifact-script-kotlin", + "file" : "Scripts/kotlin/RestconfConfigure.py" + } + } + }, + "sample-restconf-device" : { + "type" : "pnf-netconf-device", + "capabilities" : { + "restconf" : { + "properties" : { + "login-key" : { + "get_input" : "password" + }, + "login-account" : { + "get_input" : "username" + }, + "target-ip-address" : { + "get_input" : "ip" + }, + "port-number" : 830, + "connection-time-out" : 5 + } + } + } + } + } + } +} diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/artifact_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/artifact_types.json new file mode 100644 index 00000000..aa5295e4 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/artifact_types.json @@ -0,0 +1,28 @@ +{ + "artifact_types" : { + "artifact-directed-graph" : { + "description" : "Directed Graph File", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json", "xml" ] + }, + "artifact-mapping-resource" : { + "description" : "Resource Mapping File used along with Configuration template", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json" ] + }, + "artifact-script-jython" : { + "description" : "Jython Script File", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "py" ] + }, + "artifact-template-velocity" : { + "description" : " Velocity Template used for Configuration", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "vtl" ] + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/data_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/data_types.json new file mode 100644 index 00000000..d9153f3f --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/data_types.json @@ -0,0 +1,23 @@ +{ + "data_types" : { + "dt-assign-activate-properties" : { + "description" : "Dynamic DataType definition for workflow(assign-activate).", + "version" : "1.0.0", + "properties" : { + "hostname" : { + "type" : "string" + }, + "ip": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "derived_from" : "tosca.datatypes.Dynamic" + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/node_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/node_types.json new file mode 100644 index 00000000..c8e3e6a9 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/node_types.json @@ -0,0 +1,168 @@ +{ + "node_types" : { + "component-restconf-executor" : { + "description" : "This is Restconf Configuration Component API", + "version" : "1.0.0", + "capabilities" : { + "component-node" : { + "type" : "tosca.capabilities.Node" + } + }, + "requirements" : { + "restconf-connection" : { + "capability" : "restconf", + "node" : "pnf-restconf-device", + "relationship" : "tosca.relationships.ConnectsTo" + } + }, + "interfaces" : { + "ComponentRestconfExecutor" : { + "operations" : { + "process" : { + "inputs" : { + "script-type" : { + "description" : "Script type, kotlin type is supported", + "required" : true, + "type" : "string", + "constraints" : [ { + "valid_values" : [ "kotlin", "jython", "internal" ] + } ], + "default" : "internal" + }, + "script-class-reference" : { + "description" : "Kotlin Script class name or jython script name.", + "required" : true, + "type" : "string" + }, + "instance-dependencies" : { + "description" : "Instance names to inject to Jython or Kotlin Script.", + "required" : true, + "type" : "list", + "entry_schema" : { + "type" : "string" + } + } + }, + "outputs" : { + "response-data" : { + "description" : "Execution Response Data in JSON format.", + "required" : false, + "type" : "string" + }, + "status" : { + "description" : "Status of the Component Execution ( success or failure )", + "required" : true, + "type" : "string" + } + } + } + } + } + }, + "derived_from" : "tosca.nodes.Component" + }, + "dg-generic" : { + "description" : "This is Generic Directed Graph Type", + "version" : "1.0.0", + "properties" : { + "content" : { + "required" : true, + "type" : "string" + }, + "dependency-node-templates" : { + "description" : "Dependent Step Components NodeTemplate name.", + "required" : true, + "type" : "list", + "entry_schema" : { + "type" : "string" + } + } + }, + "derived_from" : "tosca.nodes.DG" + }, + "source-input" : { + "description" : "This is Input Resource Source Node Type", + "version" : "1.0.0", + "properties" : { + "key" : { + "required" : false, + "type" : "string" + }, + "key-dependencies" : { + "required" : true, + "type" : "list", + "entry_schema" : { + "type" : "string" + } + } + }, + "derived_from" : "tosca.nodes.ResourceSource" + }, + "tosca.nodes.Component" : { + "description" : "This is default Component Node", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.DG" : { + "description" : "This is Directed Graph Node Type", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.ResourceSource" : { + "description" : "TOSCA base type for Resource Sources", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.Vnf" : { + "description" : "This is VNF Node Type", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.Pnf": { + "description": "This is the PNF Node Type", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" + }, + "pnf-restconf-device" : { + "description" : "This is a PNF Device with Restconf Capability", + "version" : "1.0.0", + "capabilities" : { + "netconf" : { + "type" : "tosca.capabilities.Restconf", + "properties" : { + "login-key" : { + "required" : true, + "type" : "string", + "default" : "sdnc" + }, + "login-account" : { + "required" : true, + "type" : "string", + "default" : "sdnc-tacacs" + }, + "source" : { + "required" : false, + "type" : "string", + "default" : "npm" + }, + "target-ip-address" : { + "required" : true, + "type" : "string" + }, + "port-number" : { + "required" : true, + "type" : "integer", + "default" : 830 + }, + "connection-time-out" : { + "required" : false, + "type" : "integer", + "default" : 30 + } + } + } + }, + "derived_from" : "tosca.nodes.Pnf" + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/policy_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/policy_types.json new file mode 100644 index 00000000..1e44cc70 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/policy_types.json @@ -0,0 +1,3 @@ +{ + "policy_types" : { } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/relationship_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/relationship_types.json new file mode 100644 index 00000000..027bfc0f --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/relationship_types.json @@ -0,0 +1,9 @@ +{ + "relationship_types" : { + "tosca.relationships.ConnectsTo" : { + "description" : "Relationship tosca.relationships.ConnectsTo", + "version" : "1.0.0", + "derived_from" : "tosca.relationships.Root" + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/resources_definition_types.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/resources_definition_types.json new file mode 100644 index 00000000..b77f451a --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Definitions/resources_definition_types.json @@ -0,0 +1,16 @@ +{ + "hostname" : { + "tags" : "hostname", + "name" : "hostname", + "property" : { + "description" : "hostname", + "type" : "string" + }, + "updated-by" : "Singal, Kapil ", + "sources" : { + "input" : { + "type" : "source-input" + } + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configAssign.xml b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configAssign.xml new file mode 100644 index 00000000..417f72de --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configAssign.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configure.xml b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configure.xml new file mode 100644 index 00000000..94fe6dde --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Plans/CONFIG_configure.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfAssignConfig.kts b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfAssignConfig.kts new file mode 100644 index 00000000..a0990367 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfAssignConfig.kts @@ -0,0 +1 @@ +TBD diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfConfigure.kts b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfConfigure.kts new file mode 100644 index 00000000..a0990367 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Scripts/RestconfConfigure.kts @@ -0,0 +1 @@ +TBD diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/TOSCA-Metada/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/TOSCA-Metada/TOSCA.meta new file mode 100644 index 00000000..6ac9caf5 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/TOSCA-Metada/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0.0 +CSAR-Version: 1.0 +Created-By: Rodrigo Ottero +Entry-Definitions: Definitions/activation-blueprint.json +Template-Tags: activation-blueprint diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json new file mode 100644 index 00000000..85533abc --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json @@ -0,0 +1,16 @@ + +[ + { + "name": "odl_host", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "odl_host", + "dictionary-source": "capability", + "dependencies": [ + ] + } +] diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl new file mode 100644 index 00000000..e3d7a671 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl @@ -0,0 +1,19 @@ + +example-patch +Example patch + + edit1 + create + /car-entry + + + 0 + + + + + edit2 + delete + /car-entry/0 + + diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json new file mode 100644 index 00000000..123680c0 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json @@ -0,0 +1,38 @@ + +[ + { + "name": "pnf_id", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "pnf_id", + "dictionary-source": "capability", + "dependencies": [ + ] + }, + { + "name": "pnf_ip", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "pnf_ip", + "dictionary-source": "capability", + "dependencies": [ + ] + }, + { + "name": "pnf_ip_port", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "pnf_ip_port", + "dictionary-source": "capability", + "dependencies": [ + ] + } +] diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl new file mode 100644 index 00000000..17f7a367 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl @@ -0,0 +1,14 @@ + + $pnf_id + + ODL-private-key + netconf + + $pnf_ip + $pnf_ip_port + false + + TLS + + 2 + diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl new file mode 100644 index 00000000..a0990367 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl @@ -0,0 +1 @@ +TBD diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/scripts/InternalSimpleRestconf.cba.kts b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/scripts/InternalSimpleRestconf.cba.kts index 1c4ba9b6..dbbebe52 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/scripts/InternalSimpleRestconf.cba.kts +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/scripts/InternalSimpleRestconf.cba.kts @@ -13,9 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:Suppress("unused") //TODO remove this line! + +import com.fasterxml.jackson.databind.node.ObjectNode +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ActionIdentifiers +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.executor.RestconfComponentFunction +import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory open class EditConfigure : RestconfComponentFunction() { @@ -27,7 +33,7 @@ open class EditConfigure : RestconfComponentFunction() { } override fun process(executionRequest: ExecutionServiceInput) { - val webClientService = restClientService("odlparent") + //val webClientService = restClientService("odlparent") TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } @@ -46,12 +52,15 @@ open class MountNEditConfigure : RestconfComponentFunction() { override fun process(executionRequest: ExecutionServiceInput) { val webClientService = restClientService("odlparent") + println("foi?") TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } + + } /** @@ -72,4 +81,20 @@ open class TestRestconfConfigure : RestconfComponentFunction() { override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { log.info("recovering..") } -} \ No newline at end of file +} + + + +println("zzzzzzzzzzzzz") +val x = MountNEditConfigure() +println(x.getName()) +val executionServiceInput = ExecutionServiceInput().apply { + commonHeader = CommonHeader().apply { + requestId = "1234" + } + actionIdentifiers = ActionIdentifiers().apply { + actionName = "activate" + } + payload = JacksonUtils.jsonNode("{}") as ObjectNode +} +x.process(executionServiceInput); \ No newline at end of file -- cgit 1.2.3-korg