From 6f7a427e53f4e129d84198f4c94036b4fe6b3898 Mon Sep 17 00:00:00 2001 From: tragait Date: Wed, 6 Nov 2019 11:44:11 +0000 Subject: CCSDK-1603:Changes in 'Config via netconf' BP to pull data from AAI This commit includes changes in blueprint for "Configuration over netconf", So that CDS can fetch data from AAI. It has enhancement in UAT test yaml file, so this blueprint can be tested. An enhancement is also included to introduce request headers in the source-rest. Change-Id: I4ff973538249925239b89da4c5720ec63ffe8037 Issue-ID: CCSDK-1603 Signed-off-by: tragait --- .../Definitions/activation-blueprint.json | 40 ++-------- .../pnf_config/Definitions/node_types.json | 92 +++++++++++++++++++++- .../Definitions/resources_definition_types.json | 27 +++++-- .../pnf_config/Environments/source-db.properties | 1 + .../pnf_config/Environments/source-rest.properties | 9 +++ .../Scripts/python/RestconfConfigDeploy.py | 2 +- .../uat-blueprints/pnf_config/Tests/uat.yaml | 8 +- 7 files changed, 132 insertions(+), 47 deletions(-) create mode 100644 components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-db.properties create mode 100644 components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-rest.properties (limited to 'components/model-catalog/blueprint-model/uat-blueprints/pnf_config') diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json index d185128d5..1a7ba559a 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json @@ -32,7 +32,7 @@ "steps" : { "activate-process" : { "description" : "Create a configlet", - "target" : "config-assign-process", + "target" : "config-assign", "activities" : [ { "call_operation" : "" } ] @@ -58,7 +58,7 @@ "steps" : { "activate-process" : { "description" : "Send a configlet to the pnf", - "target" : "config-deploy-process", + "target" : "config-deploy", "activities" : [ { "call_operation" : "" } ] @@ -78,21 +78,6 @@ } }, "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-resource-resolution", "interfaces" : { @@ -104,7 +89,7 @@ "get_input" : "resolution-key" }, "store-result" : true, - "artifact-prefix-names" : ["config-assign"] + "artifact-prefix-names" : [ "config-assign" ] }, "outputs" : { "resource-assignment-params" : { @@ -127,21 +112,6 @@ } } }, - "config-deploy-process" : { - "type" : "dg-generic", - "properties" : { - "content" : { - "get_artifact" : [ "SELF", "dg-config-deploy-process" ] - }, - "dependency-node-templates" : [ "config-deploy" ] - }, - "artifacts" : { - "dg-config-assign-process" : { - "type" : "artifact-directed-graph", - "file" : "Plans/CONFIG_configDeploy.xml" - } - } - }, "config-deploy" : { "type" : "component-script-executor", "interfaces" : { @@ -149,7 +119,9 @@ "operations" : { "process" : { "implementation" : { - "primary" : "component-script" + "primary" : "component-script", + "timeout" : 180, + "operation_host" : "SELF" }, "inputs" : { "script-type" : "jython", diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/node_types.json b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/node_types.json index 8c2c0abea..bfae6779e 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/node_types.json +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/node_types.json @@ -24,6 +24,12 @@ "required" : false, "type" : "string" }, + "occurrence" : { + "description" : "Number of time to perform the resolution.", + "required" : false, + "type" : "integer", + "default" : 1 + }, "store-result" : { "description" : "Whether or not to store the output.", "required" : false, @@ -80,8 +86,14 @@ "derived_from" : "tosca.nodes.Component" }, "component-script-executor" : { - "description" : "This is Restconf Transaction Configuration Component API", + "description" : "This is CLI Transaction Configuration Component API", "version" : "1.0.0", + "attributes" : { + "response-data" : { + "required" : false, + "type" : "json" + } + }, "capabilities" : { "component-node" : { "type" : "tosca.capabilities.Node" @@ -114,7 +126,7 @@ }, "outputs" : { "response-data" : { - "description" : "Execution Response Data in JSON format.", + "description" : "Execution Response Data.", "required" : false, "type" : "string" }, @@ -155,6 +167,82 @@ "properties" : { }, "derived_from" : "tosca.nodes.ResourceSource" }, + "source-rest" : { + "description" : "This is Rest Resource Source Node Type", + "version" : "1.0.0", + "properties" : { + "type" : { + "required" : true, + "type" : "string", + "constraints" : [ { + "valid_values" : [ "JSON" ] + } ], + "default" : "JSON" + }, + "headers" : { + "required" : false, + "type" : "map", + "entry_schema" : { + "type" : "string" + } + }, + "verb" : { + "required" : true, + "type" : "string", + "constraints" : [ { + "valid_values" : [ "GET", "POST", "DELETE", "PUT" ] + } ], + "default" : "GET" + }, + "payload" : { + "required" : false, + "type" : "string", + "default" : "" + }, + "endpoint-selector" : { + "required" : false, + "type" : "string" + }, + "url-path" : { + "required" : true, + "type" : "string" + }, + "path" : { + "required" : true, + "type" : "string" + }, + "expression-type" : { + "required" : false, + "type" : "string", + "constraints" : [ { + "valid_values" : [ "JSON_PATH", "JSON_POINTER" ] + } ], + "default" : "JSON_PATH" + }, + "input-key-mapping" : { + "required" : false, + "type" : "map", + "entry_schema" : { + "type" : "string" + } + }, + "output-key-mapping" : { + "required" : false, + "type" : "map", + "entry_schema" : { + "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", diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/resources_definition_types.json b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/resources_definition_types.json index 114eb1992..d1183f14b 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/resources_definition_types.json +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/resources_definition_types.json @@ -15,17 +15,32 @@ } }, "pnf-ipv4-address" : { - "tags" : "pnf-ipv4-address", + "tags" : "aai-get", "name" : "pnf-ipv4-address", "property" : { - "description" : "pnf-ipv4-address", + "description" : "primary aai data to get resource", "type" : "string" }, - "updated-by" : "Rodrigo Ottero ", + "updated-by" : "Rahul, Tyagi ", "sources" : { - "input" : { - "type" : "source-input", - "properties" : { } + "aai-data" : { + "type" : "source-rest", + "properties" : { + "type" : "JSON", + "verb" : "GET", + "url-path" : "/aai/v14/network/pnfs/pnf/$pnf-id", + "path" : "/ipaddress-v4-oam", + "input-key-mapping" : { + "pnf-id" : "pnf-id" + }, + "headers" : { + "Accept" : "application/json" + }, + "output-key-mapping" : { + "ipaddress-v4-oam" : "value" + }, + "key-dependencies" : [ "pnf-id" ] + } } } } diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-db.properties b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-db.properties new file mode 100644 index 000000000..49a7eb47b --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-db.properties @@ -0,0 +1 @@ +dynamic-db-source.password=sdnctl \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-rest.properties b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-rest.properties new file mode 100644 index 000000000..b07c80995 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Environments/source-rest.properties @@ -0,0 +1,9 @@ +blueprintsprocessor.restclient.sdnc.type=basic-auth +blueprintsprocessor.restclient.sdnc.url=http://127.0.0.1:9111 +blueprintsprocessor.restclient.sdnc.userId=sampleuser +blueprintsprocessor.restclient.sdnc.token=sampletoken + +blueprintsprocessor.restclient.sdnc1.type=basic-auth +blueprintsprocessor.restclient.sdnc1.url=http://127.0.0.1:9111 +blueprintsprocessor.restclient.sdnc1.userId=sampleuser +blueprintsprocessor.restclient.sdnc1.token=sampletoken \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/python/RestconfConfigDeploy.py b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/python/RestconfConfigDeploy.py index f8225e0ce..af0b7e129 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/python/RestconfConfigDeploy.py +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/python/RestconfConfigDeploy.py @@ -24,7 +24,7 @@ class RestconfConfigDeploy(AbstractScriptComponentFunction): log = globals()["log"] configlet_template_name = "config-assign" configlet_resource_path = "/yang-ext:mount/mynetconf:netconflist" - restconf_server_identifier = "sdncodl" + restconf_server_identifier = "sdnc" def process(self, execution_request): diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml index fbdb2eea8..518bbe020 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml +++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml @@ -18,7 +18,6 @@ processes: config-assign-properties: service-instance-id: siid_1234 pnf-id: &pnfId pnf-id-2019-07-12 - pnf-ipv4-address: &pnfAddress "192.168.100.11" service-model-uuid: service-model-uuid pnf-customization-uuid: pnf-customization-uuid expectedResponse: @@ -45,9 +44,10 @@ processes: config-deploy-properties: service-instance-id: siid_1234 pnf-id: *pnfId - pnf-ipv4-address: *pnfAddress service-model-uuid: service-model-uuid pnf-customization-uuid: pnf-customization-uuid + pnf-ipv4-address: &pnfAddress 13.13.13.13 + ipaddress-v6-oam: 1::13 expectedResponse: commonHeader: *commonHeader actionIdentifiers: *deploy-ai @@ -60,7 +60,7 @@ processes: message: success external-services: - - selector: sdncodl + - selector: sdnc expectations: - request: method: PUT @@ -114,4 +114,4 @@ external-services: value: { netconflist: { netconf: [ { netconf-id: "30", netconf-param: "3000" }]}} - request: method: DELETE - path: *configUri + path: *configUri \ No newline at end of file -- cgit 1.2.3-korg