From: Rodrigo Ottero Date: Thu, 28 Feb 2019 14:08:55 +0000 (+0000) Subject: *WIP*: draft of a blueprint for configuring a PNF X-Git-Tag: 0.4.2~163^2~18^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=5d9772fbec43dd9f5b8a7de6192e4b8c8fe71c40;hp=48e17e6a66dd6de7bd39e196fe6b18cba399ef69;p=ccsdk%2Fcds.git *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 --- 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 000000000..96ae88e59 --- /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 000000000..aa5295e44 --- /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 000000000..d9153f3f0 --- /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 000000000..c8e3e6a93 --- /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 000000000..1e44cc70a --- /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 000000000..027bfc0fc --- /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 000000000..b77f451ad --- /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 000000000..417f72de9 --- /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 000000000..94fe6dde0 --- /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 000000000..a0990367e --- /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 000000000..a0990367e --- /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 000000000..6ac9caf57 --- /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 000000000..85533abc5 --- /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 000000000..e3d7a6716 --- /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 000000000..123680c0c --- /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 000000000..17f7a3679 --- /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 000000000..a0990367e --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl @@ -0,0 +1 @@ +TBD