diff options
author | 2018-02-12 20:55:54 +0100 | |
---|---|---|
committer | 2018-02-23 11:44:45 +0100 | |
commit | b17042b955489d8a023d09abad5436ff9b900dc3 (patch) | |
tree | 1e4392ac04a2fb1ed8d17075d504cf6594acaf16 /nokiav2/driver/src/main/resources | |
parent | d4982f7b1777e9cdae9a4cc7d0d104263889ac69 (diff) |
Updating Nokia driver
Change-Id: I950afe6acbdb359cd67a448024f006a45e8fc293
Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com>
Issue-ID: VFC-728
Diffstat (limited to 'nokiav2/driver/src/main/resources')
7 files changed, 897 insertions, 0 deletions
diff --git a/nokiav2/driver/src/main/resources/MainServiceTemplate.meta b/nokiav2/driver/src/main/resources/MainServiceTemplate.meta new file mode 100644 index 00000000..01f85b17 --- /dev/null +++ b/nokiav2/driver/src/main/resources/MainServiceTemplate.meta @@ -0,0 +1,7 @@ +metadata: + vnf_product_name: VNF_PRODUCT_NAME + vnf_provider_id: Nokia + vnf_package_version: VNF_PACKAGE_VERSION + vnf_release_data_time: 2017.01.01T10:00+03:00 + +source: MainServiceTemplate.yaml
\ No newline at end of file diff --git a/nokiav2/driver/src/main/resources/TOSCA.meta b/nokiav2/driver/src/main/resources/TOSCA.meta new file mode 100644 index 00000000..5cb64478 --- /dev/null +++ b/nokiav2/driver/src/main/resources/TOSCA.meta @@ -0,0 +1,4 @@ +TOSCA-Meta-Version: 1.0 +CSAR-Version: 1.0 +Created-By: Kuku +Entry-Definitions: Definitions/MainServiceTemplate.yaml diff --git a/nokiav2/driver/src/main/resources/cbam.collectConnectionPoints.js b/nokiav2/driver/src/main/resources/cbam.collectConnectionPoints.js new file mode 100644 index 00000000..f5cfc675 --- /dev/null +++ b/nokiav2/driver/src/main/resources/cbam.collectConnectionPoints.js @@ -0,0 +1,71 @@ +var collectConnectionPoints = function(resourceModel, diff) { + return collectPorts(resourceModel, diff) +}; + +function collectPorts(resourceModel, diff){ + pathToResource = {} + collectResources('', resourceModel, pathToResource, true); + transformedPorts = [] + Object.keys(pathToResource).forEach(function (path) { + var port = pathToResource[path]; + transformedPort = {} + transformedPort.name = port.attributes.name; + transformedPort.providerId = port.attributes.id; + transformedPort.cpId = path; + var managedPort = false; + if(port.hasOwnProperty('externalConnectionPoint')){ + transformedPort.ecpdId = port.externalConnectionPoint; + managedPort = true; + } + if(port.hasOwnProperty('connectionPoint')){ + transformedPort.cpdId = port.connectionPoint; + managedPort = true; + } + transformedPort.tenantId = port.attributes.tenant_id; + transformedPort.ipAddress = port.attributes.fixed_ips[0].ip_address; + transformedPort.macAddress = port.attributes.mac_address; + transformedPort.serverProviderId = port.attributes.device_id; + transformedPort.networkProviderId = port.attributes.network_id; + transformedPort.changeType = 'untouched'; + var added = contains(diff.add, path); + var removed = contains(diff.remove, path); + if(added && removed){ + transformedPort.changeType = "MODIFIED"; + } + else{ + if(removed){ + transformedPort.changeType = "REMOVED"; + } + if(added){ + transformedPort.changeType = "ADDED"; + } + } + if('untouched' != transformedPort.changeType && managedPort){ + transformedPorts.push(transformedPort) + } + }) + return transformedPorts; +}; + +function contains(resourceChanges, path){ + var keys = Object.keys(resourceChanges); + return keys.indexOf(path) !== -1; +} + +function collectResources(path, root, pathToResouceMap, onResources){ + root && Object.keys(root).forEach(function(item) { + if(item == 'resource_type' && root[item] == 'OS::Neutron::Port'){ + pathToResouceMap[path] = root + } + else if(typeof root[item] === "object"){ + var newItem = onResources ? "" : item; + var newPath = path; + if('' != newItem && path != ''){ + newPath += "."; + } + newPath += newItem; + collectResources(newPath, root[item], pathToResouceMap, !onResources) + } + }); +}; + diff --git a/nokiav2/driver/src/main/resources/cbam.post.collectConnectionPoints.js b/nokiav2/driver/src/main/resources/cbam.post.collectConnectionPoints.js new file mode 100644 index 00000000..c70d36ed --- /dev/null +++ b/nokiav2/driver/src/main/resources/cbam.post.collectConnectionPoints.js @@ -0,0 +1,4 @@ +return { + "cbam_post" : collectConnectionPoints($.resource_model, $.model_diff), + "cbam_pre" : $.operation_result.cbam_pre + } diff --git a/nokiav2/driver/src/main/resources/cbam.pre.collectConnectionPoints.js b/nokiav2/driver/src/main/resources/cbam.pre.collectConnectionPoints.js new file mode 100644 index 00000000..64153a20 --- /dev/null +++ b/nokiav2/driver/src/main/resources/cbam.pre.collectConnectionPoints.js @@ -0,0 +1 @@ +return { "cbam_pre" : collectConnectionPoints($.resource_model, $.model_diff) } diff --git a/nokiav2/driver/src/main/resources/self.swagger.json b/nokiav2/driver/src/main/resources/self.swagger.json new file mode 100644 index 00000000..f8d24a0b --- /dev/null +++ b/nokiav2/driver/src/main/resources/self.swagger.json @@ -0,0 +1,798 @@ +{ + "basePath": "/api/NokiaSVNFM/v1", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "contact": { + "email": "onap-discuss@lists.onap.org", + "name": "Nokia team", + "url": "https://gerrit.onap.org/r/#/admin/projects/vfc/nfvo/lcm" + }, + "description": "ONAP Nokia CBAM Driver API.", + "title": "ONAP Nokia CBAM Driver API", + "version": "1.0.0" + }, + "definitions": { + "JobDetailInfo": { + "properties": { + "jobId": { + "type": "string" + }, + "responseDescriptor": { + "properties": { + "errorCode": { + "type": "string" + }, + "progress": { + "description": "The progress of the job. Value between 0 and 100.", + "type": "string" + }, + "responseHistoryList": { + "items": { + "$ref": "#/definitions/jobResponseInfo" + }, + "type": "array" + }, + "responseId": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/JobStatus", + "description": "The status of the job" + }, + "statusDescription": { + "description": "The reason of the current status of the job.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "JobInfo": { + "properties": { + "jobId": { + "type": "string" + } + }, + "type": "object" + }, + "JobStatus": { + "description": "The status of the job", + "enum": [ + "started", + "processing", + "finished", + "error", + "timeout" + ], + "type": "string" + }, + "ScaleDirection": { + "description": "The direction of the scaling", + "enum": [ + "SCALE_IN", + "SCALE_OUT" + ], + "type": "string" + }, + "VimInfo": { + "properties": { + "createTime": { + "description": "vim info createTime", + "type": "string" + }, + "description": { + "description": "vim description", + "type": "string" + }, + "name": { + "description": "vim name", + "type": "string" + }, + "password": { + "description": "vim login password", + "type": "string" + }, + "sslCacert": { + "description": "The collection of trusted certificates towards the VIM connection.", + "type": "string" + }, + "sslInsecure": { + "description": "Whether to verify VIM's certificate", + "type": "string" + }, + "status": { + "description": "The status of external system", + "type": "string" + }, + "type": { + "description": "vim type", + "type": "string" + }, + "url": { + "description": "vim url", + "type": "string" + }, + "userName": { + "description": "vim login username", + "type": "string" + }, + "vendor": { + "description": "vendor name", + "type": "string" + }, + "version": { + "description": "vim version", + "type": "string" + }, + "vimId": { + "description": "vim Id", + "type": "string" + } + }, + "type": "object" + }, + "VnfHealRequest": { + "properties": { + "action": { + "type": "string" + }, + "affectedvm": { + "properties": { + "vduid": { + "type": "string" + }, + "vimid": { + "type": "string" + }, + "vmname": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "VnfInfo": { + "properties": { + "version": { + "type": "string" + }, + "vnfInstanceDescription": { + "type": "string" + }, + "vnfId": { + "type": "string" + }, + "vnfInstanceName": { + "type": "string" + }, + "vnfPackageId": { + "type": "string" + }, + "vnfProvider": { + "type": "string" + }, + "vnfStatus": { + "type": "string" + }, + "vnfType": { + "type": "string" + }, + "vnfdId": { + "type": "string" + } + }, + "type": "object" + }, + "VnfInstInfo": { + "properties": { + "vnfId": { + "description": "VNF instance ID", + "type": "string" + }, + "vnfInstanceName": { + "description": "VNF instance name", + "type": "string" + } + }, + "type": "object" + }, + "VnfInstListInfo": { + "items": { + "$ref": "#/definitions/VnfInstInfo" + }, + "type": "array" + }, + "VnfInstantiateRequest": { + "properties": { + "additionalParam": { + "type": "object" + }, + "extVirtualLink": { + "items": { + "$ref": "#/definitions/extVirtualLinkInfo" + }, + "type": "array" + }, + "vnfDescriptorId": { + "type": "string" + }, + "vnfInstanceDescription": { + "type": "string" + }, + "vnfInstanceName": { + "type": "string" + }, + "vnfPackageId": { + "type": "string" + } + }, + "type": "object" + }, + "VnfInstantiateResponse": { + "properties": { + "jobId": { + "type": "string" + }, + "vnfId": { + "type": "string" + } + }, + "type": "object" + }, + "VnfScaleRequest": { + "properties": { + "additionalParam": { + "description": "Additional parameters passed by the NFVO as input to the scaling process, specific to the VNF being scaled", + "type": "object" + }, + "aspectId": { + "description": "Identifies the aspect of the VNF that is requested to be scaled", + "type": "string" + }, + "numberOfSteps": { + "description": "Number of scaling steps to be executed as part of this ScaleVnf operation. It shall be a positive number", + "type": "string" + }, + "type": { + "$ref": "#/definitions/ScaleDirection", + "description": "The direction of the scaling." + } + }, + "type": "object" + }, + "VnfTerminateRequest": { + "properties": { + "gracefulTerminationTimeout": { + "description": "The time interval(second) to wait for the VNF to be taken out of service during graceful termination.", + "type": "string" + }, + "terminationType": { + "$ref": "#/definitions/VnfTerminationType", + "description": "The type of the termination" + } + }, + "type": "object" + }, + "VnfTerminationType": { + "description": "The type of the termination.", + "enum": [ + "graceful", + "forceful" + ], + "type": "string" + }, + "extVirtualLinkInfo":{ + "type": "object", + "properties": { + "resourceSubnetId": { + "type": "string", + "description": "The provider id of the subnet" + }, + "vlInstanceId": { + "type": "string", + "description" : "The identifier of the virtual link" + }, + "resourceId": { + "type": "string", + "description": "The provider id of the network" + }, + "cpdId": { + "type": "string", + "description": "The identifier of the connection point descriptor" + }, + "vim": { + "type": "object", + "properties": { + "vimid": { + "type": "string", + "description": "The identifier of the VIM" + } + } + } + } + }, + "jobResponseInfo": { + "properties": { + "errorCode": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "responseId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "statusDescription": { + "type": "string" + } + }, + "type": "object" + }, + "vimInfo": { + "properties": { + "accessInfo": { + "properties": { + "password": { + "description": "Password of login user", + "type": "string" + }, + "tenant": { + "description": "Tenant Name of tenant", + "type": "string" + }, + "username": { + "description": "Username for login", + "type": "string" + } + }, + "type": "object" + }, + "interfaceEndpoint": { + "description": "Information about the interface endpoint. It is a URL", + "type": "string" + }, + "interfaceInfo": { + "properties": { + "apiVersion": { + "description": "The api Version Type value will be ", + "type": "string" + }, + "protocolType": { + "description": "The protocol Type value will be http or https", + "type": "string" + }, + "vimType": { + "description": "The vim Type value wil be openstack", + "type": "string" + } + }, + "type": "object" + }, + "vimId": { + "type": "string" + }, + "vimInfoId": { + "type": "string" + } + }, + "type": "object" + }, + "VnfLifecycleChangeNotification": { + "type": "object", + "description": "The lifecycle change notifications send from CBAM" + } + }, + "paths": { + "/{vnfmId}/vnfs": { + "post": { + "consumes": [ + "application/json" + ], + "description": "VNF create&instantiate Rest API should be provided by the VNFM Driver", + "operationId": "vnf_instantiate", + "parameters": [ + { + "description": "The value of vnfmid should be the VNFM Instantiate ID", + "in": "path", + "name": "vnfmId", + "required": true, + "type": "string" + }, + { + "description": "instantiate request param", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VnfInstantiateRequest" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/VnfInstantiateResponse" + } + } + }, + "summary": "vnf create&instantiate", + "tags": [ + "VNFMDriver" + ] + } + }, + "/{vnfmId}/vnfs/{vnfId}": { + "get": { + "consumes": [ + "application/json" + ], + "description": "", + "operationId": "query_vnf", + "parameters": [ + { + "description": "The value of vnfmId should be the VNFM Instantiate ID", + "in": "path", + "name": "vnfmId", + "required": true, + "type": "string" + }, + { + "description": "The value of vnfId should be the VNF Instantiate ID", + "in": "path", + "name": "vnfId", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/VnfInfo" + } + }, + "404": { + "description": "the vnf instance id is wrong" + }, + "500": { + "description": "the url is invalid" + } + }, + "summary": "query the specified vnf info", + "tags": [ + "VNFMDriver" + ] + } + }, + "/{vnfmId}/vnfs/{vnfId}/heal": { + "post": { + "consumes": [ + "application/json" + ], + "description": "VNF Heal Rest API should be provided by the VNFM Driver", + "operationId": "vnf_heal", + "parameters": [ + { + "description": "The value of vnfmId should be the VNFM Instantiate ID", + "in": "path", + "name": "vnfmId", + "required": true, + "type": "string" + }, + { + "description": "The value of vnfId should be the VNF Instantiate ID", + "in": "path", + "name": "vnfId", + "required": true, + "type": "string" + }, + { + "description": "instantiate request param", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VnfHealRequest" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/JobInfo" + } + }, + "404": { + "description": "the VNF instance id is wrong" + }, + "500": { + "description": "the url is invalid" + } + }, + "summary": "vnf heal", + "tags": [ + "VNFMDriver" + ] + } + }, + "/{vnfmId}/vnfs/{vnfId}/scale": { + "post": { + "consumes": [ + "application/json" + ], + "description": "VNF Scale Rest API should be provided by the VNFM Driver", + "operationId": "vnf_scale", + "parameters": [ + { + "description": "The value of vnfmId should be the VNFM Instantiate ID", + "in": "path", + "name": "vnfmId", + "required": true, + "type": "string" + }, + { + "description": "The value of vnfId should be the VNF Instantiate ID", + "in": "path", + "name": "vnfId", + "required": true, + "type": "string" + }, + { + "description": "instantiate request param", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VnfScaleRequest" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/JobInfo" + } + }, + "404": { + "description": "the VNF instance id is wrong" + }, + "500": { + "description": "the url is invalid" + } + }, + "summary": "vnf Scale", + "tags": [ + "VNFMDriver" + ] + } + }, + "/{vnfmId}/vnfs/{vnfId}/terminate": { + "post": { + "consumes": [ + "application/json" + ], + "description": "VNF terminate&delete Rest API should be provided by the VNFM Driver", + "operationId": "terminate_vnf", + "parameters": [ + { + "description": "The value of vnfmId should be the VNFM Instantiate ID", + "in": "path", + "name": "vnfmId", + "required": true, + "type": "string" + }, + { + "description": "The value of vnfId should be the VNF Instantiate ID", + "in": "path", + "name": "vnfId", + "required": true, + "type": "string" + }, + { + "description": "instantiate request param", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VnfTerminateRequest" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/JobInfo" + } + }, + "404": { + "description": "the VNF instance id is wrong" + }, + "500": { + "description": "the url is invalid" + } + }, + "summary": "terminate&delete vnf", + "tags": [ + "VNFMDriver" + ] + } + }, + "/{vnfmId}/jobs/{jobId}": { + "get": { + "tags": [ + "VNFMDriver" + ], + "summary": "jobstatus", + "description": "Job Infomation API should be provided by VNFM Driver", + "operationId": "get_jobstatus", + "parameters": [ + { + "required": true, + "type": "string", + "description": "job Id", + "name": "jobId", + "in": "path" + }, + { + "required": true, + "type": "string", + "description": "The value of vnfmId should be the VNFM Instantiate ID", + "name": "vnfmId", + "in": "path" + }, + { + "required": true, + "type": "string", + "description": "job response message id", + "name": "responseId", + "in": "query" + } + ], + "responses": { + "202": { + "description": "", + "schema": { + "$ref": "#/definitions/JobDetailInfo" + } + } + } + } + }, + "/lcn":{ + "get": { + "tags": [ + "SBI" + ], + "summary": "Test LCN connectivity from CBAM to driver", + "description": "Test LCN connectivity from CBAM to driver", + "responses": { + "204": { + "description": "Used for connectivity test" + } + } + }, + "post": { + "tags": [ + "SBI" + ], + "consumes": [ + "application/json" + ], + "summary": "Send LCN from CBAM", + "description": "Test LCN connectivity from CBAM to driver", + "parameters": [ + { + "description": "The life cycle change notification", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VnfLifecycleChangeNotification" + } + } + ], + "responses": { + "204": { + "description": "Used for connectivity test" + } + } + } + }, + "/swagger.json": { + "get": { + "tags": [ + "Utilities" + ], + "summary": "The Nokia SVNFM API definition", + "description": "The Nokia SVNFM API definition", + "responses": { + "202": { + "description": "The swagger API definition" + } + } + } + }, + "/convert": { + "post": { + "tags": [ + "Utilities" + ], + "consumes":[ + "multipart/form-data" + ], + "produces":[ + "application/octet-stream" + ], + "parameters" : [ + { + "description": "The CBAM VNF package", + "in": "formData", + "name": "upfile", + "type": "file" + } + ], + "summary": "Converts the Nokia CBAM package to ONAP package", + "description": "Converts the Nokia CBAM package to ONAP package", + "responses": { + "200": { + "description": "The converted package", + "schema":{ + "type": "file" + } + } + } + }, + "get": { + "tags": [ + "Utilities" + ], + "produces":[ + "text/html" + ], + "summary": "UI to convert the Nokia CBAM package to ONAP package", + "description": "UI to convert the Nokia CBAM package to ONAP package", + "responses": { + "200": { + "description": "The converted package" + } + } + } + + } + } +} diff --git a/nokiav2/driver/src/main/resources/upload.html b/nokiav2/driver/src/main/resources/upload.html new file mode 100644 index 00000000..a5c686f4 --- /dev/null +++ b/nokiav2/driver/src/main/resources/upload.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<body> + +<form action="/api/NokiaSVNFM/v1/convert" method="post" enctype="multipart/form-data"> + Select CBAM package to upload: + <input type="file" name="fileToUpload" id="fileToUpload"> + <input type="submit" value="Upload" name="submit"> +</form> + +</body> +</html>
\ No newline at end of file |