1 # Copyright (c) 2019 Bell Canada.
2 # Modifications Copyright (c) 2018 - 2019 IBM, Bell Canada.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 from netconf_constant import *
16 from org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution import ResourceResolutionExtensionsKt
19 class ResolutionHelper:
21 def __init__(self, component_function):
22 self.component_function = component_function
24 def resolve_and_generate_message_from_template_prefix(self, artifact_prefix):
25 """Get the template resolved in the current workflow execution by the artifact prefix
27 :param artifact_prefix:
30 return ResourceResolutionExtensionsKt.contentFromResolvedArtifact(self.component_function, artifact_prefix)
32 def retrieve_resolved_template_from_database(self, key, artifact_template):
33 """Get the template resolved and stored with resolution-key and matching with the artifact name
36 :param artifact_template:
39 return ResourceResolutionExtensionsKt.storedContentFromResolvedArtifact(self.component_function, key,
42 def set_execution_attribute_response_data(self, response_data):
43 """For the current node execution, set the attribute value of response-data
48 self.component_function.setAttribute(ATTRIBUTE_RESPONSE_DATA, response_data)
50 def get_node_template_attribute(self, node_template_name, attribute_key):
51 """get attribute value for a specific node template of the current workflow
53 :param node_template_name:
57 self.component_function.getNodeTemplateAttribute(node_template_name, attribute_key)
59 def get_input_value(self, key):
60 """Get input value of the current node template execution
65 self.component_function.bluePrintRuntimeService.getInputValue(key)