aboutsummaryrefslogtreecommitdiffstats
path: root/epsdk-app-onap
diff options
context:
space:
mode:
authorbmatt <Brian.Matt@windstream.com>2017-09-14 19:36:54 +0000
committerbmatt <Brian.Matt@windstream.com>2017-09-15 13:03:17 +0000
commit2c7338c6729486408842bcdc51143de327a5f349 (patch)
treec7a59b6540b6a7aaddb4b094f3e5bc62c6241b3d /epsdk-app-onap
parent138adfa2ca115e3929964abd998df02c3318d58e (diff)
Pointed to SO API v4
Updated system_template.propreties to point to SO API v4 since v2 seems to have been removed. Change-Id: I8d0572815b509ed8732d87ae22829b7054cb8895 Issue-ID: VID-63 Signed-off-by: bmatt <Brian.Matt@windstream.com>
Diffstat (limited to 'epsdk-app-onap')
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties14
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties14
2 files changed, 14 insertions, 14 deletions
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
index 7ee75e32..c0e9e347 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
@@ -158,13 +158,13 @@ mso.polling.interval.msecs=2000
mso.max.polls=3
mso.user.name=infraportal
mso.password.x=OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz
-mso.restapi.svc.instance=/serviceInstances/v3
-mso.restapi.vnf.instance=/serviceInstances/v3/<service_instance_id>/vnfs
-mso.restapi.network.instance=/serviceInstances/v3/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
-mso.restapi.volume.group.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
-mso.restapi.get.orc.req=/orchestrationRequests/v3
-mso.restapi.get.orc.reqs=/orchestrationRequests/v3?
+mso.restapi.svc.instance=/serviceInstances/v4
+mso.restapi.vnf.instance=/serviceInstances/v4/<service_instance_id>/vnfs
+mso.restapi.network.instance=/serviceInstances/v4/<service_instance_id>/networks
+mso.restapi.vf.module.instance=/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.volume.group.instance=/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.get.orc.req=/orchestrationRequests/v4
+mso.restapi.get.orc.reqs=/orchestrationRequests/v4?
vid.truststore.filename=/opt/app/vid/etc/vid_keystore.jks
mso.dme2.client.timeout=30000
mso.dme2.client.read.timeout=120000
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
index 56ec9f30..2eabd461 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
@@ -101,13 +101,13 @@ mso.polling.interval.msecs=${MSO_POLLING_INTERVAL_MSECS}
mso.max.polls=10
mso.user.name=${VID_MSO_USER}
mso.password.x=${VID_MSO_PASS}
-mso.restapi.svc.instance=/ecomp/mso/infra/serviceInstances/v2
-mso.restapi.vnf.instance=/ecomp/mso/infra/serviceInstances/v2/<service_instance_id>/vnfs
-mso.restapi.network.instance=/ecomp/mso/infra/serviceInstances/v2/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/ecomp/mso/infra/serviceInstances/v2/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
-mso.restapi.volume.group.instance=/ecomp/mso/infra/serviceInstances/v2/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
-mso.restapi.get.orc.req=/ecomp/mso/infra/orchestrationRequests/v2
-mso.restapi.get.orc.reqs=/ecomp/mso/infra/orchestrationRequests/v2?
+mso.restapi.svc.instance=/ecomp/mso/infra/serviceInstances/v4
+mso.restapi.vnf.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs
+mso.restapi.network.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/networks
+mso.restapi.vf.module.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.volume.group.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.get.orc.req=/ecomp/mso/infra/orchestrationRequests/v4
+mso.restapi.get.orc.reqs=/ecomp/mso/infra/orchestrationRequests/v4?
vid.truststore.filename=${VID_TRUSTSTORE_FILE}
vid.truststore.passwd.x=${VID_TRUSTSTORE_PASS}
mso.dme2.client.timeout=${MSO_DME2_CLIENT_TIMEOUT}
lor: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  Copyright © 2018 IBM.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.onap.ccsdk.cds.blueprintsprocessor.services.execution

import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.BlueprintJythonService
import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintScriptsService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode
import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintScriptsServiceImpl
import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
import org.slf4j.LoggerFactory
import org.springframework.context.ApplicationContext
import org.springframework.stereotype.Service

@Service
class ComponentFunctionScriptingService(
    private val applicationContext: ApplicationContext,
    private val blueprintJythonService: BlueprintJythonService
) {

    private val log = LoggerFactory.getLogger(ComponentFunctionScriptingService::class.java)

    suspend fun <T : AbstractScriptComponentFunction> scriptInstance(
        componentFunction: AbstractComponentFunction,
        scriptType: String,
        scriptClassReference: String,
        instanceDependencies: List<String>
    ): T {

        log.info(
            "creating component function of script type($scriptType), reference name($scriptClassReference) and " +
                "instanceDependencies($instanceDependencies)"
        )

        val scriptComponent: T = scriptInstance(
            componentFunction.bluePrintRuntimeService.bluePrintContext(),
            scriptType, scriptClassReference
        )

        checkNotNull(scriptComponent) { "failed to initialize script component" }

        scriptComponent.bluePrintRuntimeService = componentFunction.bluePrintRuntimeService
        scriptComponent.processId = componentFunction.processId
        scriptComponent.workflowName = componentFunction.workflowName
        scriptComponent.stepName = componentFunction.stepName
        scriptComponent.interfaceName = componentFunction.interfaceName
        scriptComponent.operationName = componentFunction.operationName
        scriptComponent.nodeTemplateName = componentFunction.nodeTemplateName
        scriptComponent.operationInputs = componentFunction.operationInputs
        scriptComponent.executionServiceInput = componentFunction.executionServiceInput
        scriptComponent.scriptType = scriptType

        // Populate Instance Properties
        instanceDependencies.forEach { instanceDependency ->
            scriptComponent.functionDependencyInstances[instanceDependency] = applicationContext
                .getBean(instanceDependency)
        }
        return scriptComponent
    }

    suspend fun <T : BlueprintFunctionNode<*, *>> scriptInstance(
        bluePrintContext: BlueprintContext,
        scriptType: String,
        scriptClassReference: String
    ): T {
        var scriptComponent: T? = null

        when (scriptType) {
            BlueprintConstants.SCRIPT_INTERNAL -> {
                val bluePrintScriptsService: BlueprintScriptsService = BlueprintScriptsServiceImpl()
                scriptComponent = bluePrintScriptsService.scriptInstance<T>(scriptClassReference)
            }
            BlueprintConstants.SCRIPT_KOTLIN -> {
                val bluePrintScriptsService: BlueprintScriptsService = BlueprintScriptsServiceImpl()
                scriptComponent = bluePrintScriptsService.scriptInstance<T>(
                    bluePrintContext.rootPath,
                    bluePrintContext.name(), bluePrintContext.version(), scriptClassReference, false
                )
            }
            BlueprintConstants.SCRIPT_JYTHON -> {
                scriptComponent = blueprintJythonService.jythonComponentInstance(bluePrintContext, scriptClassReference) as T
            }
            else -> {
                throw BlueprintProcessorException("script type($scriptType) is not supported")
            }
        }
        return scriptComponent
    }
}