--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>cba-parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>CBA - Blueprints</name>
+ <description>CBA - Blueprints</description>
+
+ <modules>
+ <module>test-blueprint</module>
+ </modules>
+</project>
Created-By: Brinda Santh <brindasanth@in.ibm.com>
Entry-Definitions: Definitions/activation-blueprint.json
Template-Tags: Brinda Santh, activation-blueprint
+Template-Name: baseconfiguration
+Template-Version: 1.0.0
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 IBM.
+ ~ Modification Copyright © 2018-2019 AT&T Intellectual Property.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>cba-parent</artifactId>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>test-blueprint-model</artifactId>
<version>0.7.0-SNAPSHOT</version>
</parent>
- <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>capability_cli</artifactId>
- <name>CBA Capability CLI</name>
- <description>CBA Capability CLI</description>
+ <name>CBA - Test Capability CLI</name>
+ <description>CBA - Test Capability CLI</description>
<dependencies>
<dependency>
Created-By: Brinda Santh M
Entry-Definitions: Definitions/activation-blueprint.json
Template-Tags: Brinda Santh, activation-blueprint
-
-Name: Plans/ActivateProcess.bpmn
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: capability_python
+Template-Version: 1.0.0
Created-By: Alexis de Talhouët
Entry-Definitions: Definitions/golden-blueprint.json
Template-Tags: test
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: golden
+Template-Version: 1.0.0
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>test-blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>CBA - Test Blueprints</name>
+ <description>CBA - Test Blueprints</description>
+
+ <modules>
+ <module>capability_cli</module>
+ <module>resource-audit</module>
+ </modules>
+</project>
CSAR-Version: 1.0
Created-By: Serge Simard <serge@agilitae.com>
Entry-Definitions: Definitions/remote_ansible.json
-Template-Tags: Serge Simard, remote_ansible
\ No newline at end of file
+Template-Tags: Serge Simard, remote_ansible
+Template-Name: remote_ansible
+Template-Version: 1.0.0
\ No newline at end of file
Created-By: Brinda Santh <brindasanth@in.ibm.com>
Entry-Definitions: Definitions/remote_scripts.json
Template-Tags: Brinda Santh, remote_scripts
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: remote_scripts
+Template-Version: 1.0.0
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 IBM.
+ ~ Modification Copyright © 2018-2019 AT&T Intellectual Property.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>cba-parent</artifactId>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>test-blueprint-model</artifactId>
<version>0.7.0-SNAPSHOT</version>
</parent>
+
<groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>resource-audit</artifactId>
- <name>CBA Resource Audit</name>
- <description>CBA Resource Audit</description>
+
+ <name>CBA - Test Resource Audit</name>
+ <description>CBA - Test Resource Audit</description>
<dependencies>
<dependency>
"template_author" : "Rodrigo Ottero",
"author-email" : "rodrigo.ottero@est.tech",
"user-groups" : "ADMIN, OPERATION",
- "template_name" : "configuration_over_restconf",
+ "template_name" : "pnf_config",
"template_version" : "1.0.0",
"template_tags" : "pnf, restconf, config, configuration"
},
TOSCA-Meta-File-Version: 1.0.0
CSAR-Version: 1.0
Created-By: Rodrigo Ottero
-Entry-Definitions: Definitions/activation-blueprint.json
-Template-Name: activation-blueprint
+Entry-Definitions: Definitions/pnf_config.json
+Template-Name: pnf_config
Template-Version: 1.0.0
Template-Tags: activation-blueprint
requestId: "123456-1000"
subRequestId: sub-123456-1000
actionIdentifiers: &assign-ai
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config
blueprintVersion: "1.0.0"
actionName: config-assign
mode: sync
commonHeader: *commonHeader
actionIdentifiers: &deploy-ai
actionName: config-deploy
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config
blueprintVersion: "1.0.0"
mode: sync
payload:
"template_author" : "Rahul Tyagi",
"author-email" : "rahul.tyagi@est.tech",
"user-groups" : "ADMIN, OPERATION",
- "template_name" : "configuration_over_restconf",
+ "template_name" : "pnf_config_aai",
"template_version" : "1.0.0",
"template_tags" : "pnf, restconf, config, configuration"
},
TOSCA-Meta-File-Version: 1.0.0
CSAR-Version: 1.0
Created-By: Rahul Tyagi
-Entry-Definitions: Definitions/activation-blueprint.json
-Template-Name: activation-blueprint
+Entry-Definitions: Definitions/pnf_config_aai.json
+Template-Name: pnf_config_aai
Template-Version: 1.0.0
-Template-Tags: activation-blueprint
+Template-Tags: pnf_config_aai
requestId: "123456-1000"
subRequestId: sub-123456-1000
actionIdentifiers: &assign-ai
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config_aai
blueprintVersion: "1.0.0"
actionName: config-assign
mode: sync
commonHeader: *commonHeader
actionIdentifiers: &deploy-ai
actionName: config-deploy
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config_aai
blueprintVersion: "1.0.0"
mode: sync
payload:
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>components</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Components Root</name>
+ <description>Components</description>
+
+ <modules>
+ <module>model-catalog/blueprint-model</module>
+ </modules>
+</project>
)
val prepareEnvOutput = remoteScriptExecutionService.prepareEnv(prepareEnvInput)
log.info("$ATTRIBUTE_PREPARE_ENV_LOG - ${prepareEnvOutput.response}")
- val logs = JacksonUtils.jsonNodeFromObject(prepareEnvOutput.response)
- setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, logs)
- setAttribute(ATTRIBUTE_EXEC_CMD_LOG, "N/A".asJsonPrimitive())
+ val logs = prepareEnvOutput.response
+ val logsEnv = logs.toString().asJsonPrimitive()
+ setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, logsEnv)
if (prepareEnvOutput.status != StatusType.SUCCESS) {
- setNodeOutputErrors(prepareEnvOutput.status.name, logs)
+ setAttribute(ATTRIBUTE_EXEC_CMD_LOG, "N/A".asJsonPrimitive())
+ setNodeOutputErrors(prepareEnvOutput.status.name, logsEnv)
} else {
- setNodeOutputProperties(prepareEnvOutput.status.name.asJsonPrimitive(), logs, "".asJsonPrimitive())
+ setNodeOutputProperties(prepareEnvOutput.status.name.asJsonPrimitive(), logsEnv, "".asJsonPrimitive())
}
}
- // Populate command execution properties and pass it to the remote server
- val properties = dynamicProperties?.returnNullIfMissing()?.rootFieldsToMap() ?: hashMapOf()
-
- val remoteExecutionInput = RemoteScriptExecutionInput(
- requestId = processId,
- remoteIdentifier = RemoteIdentifier(blueprintName = blueprintName, blueprintVersion = blueprintVersion),
- command = scriptCommand,
- properties = properties)
- val remoteExecutionOutput = remoteScriptExecutionService.executeCommand(remoteExecutionInput)
-
- val logs = JacksonUtils.jsonNodeFromObject(remoteExecutionOutput.response)
- if (remoteExecutionOutput.status != StatusType.SUCCESS) {
- setNodeOutputErrors(remoteExecutionOutput.status.name,logs, remoteExecutionOutput.payload)
- } else {
- setNodeOutputProperties(remoteExecutionOutput.status.name.asJsonPrimitive(), logs,
- remoteExecutionOutput.payload)
+ // if Env preparation was successful, then proceed with command execution in this Env
+ if (bluePrintRuntimeService.getBluePrintError().errors.isEmpty()) {
+ // Populate command execution properties and pass it to the remote server
+ val properties = dynamicProperties?.returnNullIfMissing()?.rootFieldsToMap() ?: hashMapOf()
+
+ val remoteExecutionInput = RemoteScriptExecutionInput(
+ requestId = processId,
+ remoteIdentifier = RemoteIdentifier(blueprintName = blueprintName, blueprintVersion = blueprintVersion),
+ command = scriptCommand,
+ properties = properties)
+ val remoteExecutionOutput = remoteScriptExecutionService.executeCommand(remoteExecutionInput)
+
+ val logs = JacksonUtils.jsonNodeFromObject(remoteExecutionOutput.response)
+ if (remoteExecutionOutput.status != StatusType.SUCCESS) {
+ setNodeOutputErrors(remoteExecutionOutput.status.name, logs, remoteExecutionOutput.payload)
+ } else {
+ setNodeOutputProperties(remoteExecutionOutput.status.name.asJsonPrimitive(), logs,
+ remoteExecutionOutput.payload)
+ }
}
-
} catch (e: Exception) {
log.error("Failed to process on remote executor", e)
} finally {
*/
private fun setNodeOutputErrors(status: String, message: JsonNode, artifacts: JsonNode = "".asJsonPrimitive() ) {
setAttribute(ATTRIBUTE_EXEC_CMD_STATUS, status.asJsonPrimitive())
+ log.info("Executor status : $status")
setAttribute(ATTRIBUTE_EXEC_CMD_LOG, message)
+ log.info("Executor message : $message")
setAttribute(ATTRIBUTE_RESPONSE_DATA, artifacts)
+ log.info("Executor artifacts: $artifacts")
- addError(status, ATTRIBUTE_EXEC_CMD_LOG, message.asText())
+ addError(status, ATTRIBUTE_EXEC_CMD_LOG, message.toString())
}
}
payload_result = {}
handler = CommandExecutorHandler(request)
payload_result = handler.execute_command(request, log_results)
- if not payload_result["cds_return_code"]:
+ if payload_result["cds_return_code"] != 0:
self.logger.info("{} - Failed to executeCommand. {}".format(blueprint_id, log_results))
else:
self.logger.info("{} - Execution finished successfully.".format(blueprint_id))
- ret = utils.build_response(request, log_results, payload_result, payload_result["cds_return_code"])
+ ret = utils.build_response(request, log_results, payload_result, payload_result["cds_return_code"] == 0)
self.logger.info("Payload returned %s" % payload_result)
return ret
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2019 Bell Canada
+Modification Copyright © 2018-2019 AT&T Intellectual Property.
Unless otherwise specified, all software contained herein is licensed
under the Apache License, Version 2.0 (the License);
<modules>
<module>ms</module>
<module>cds-ui</module>
+ <module>components</module>
</modules>
<properties>