--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="13">
+ <profile kind="CodeFormatterProfile" name="ONAP_GoogleStyle" version="13">
+ <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled" />
+ <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="11" />
+ <setting id="org.eclipse.jdt.core.compiler.compliance" value="11" />
+ <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error" />
+ <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error" />
+ <setting id="org.eclipse.jdt.core.compiler.source" value="11" />
+ <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent" value="1585|-1|1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent" value="1585|-1|1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent" value="1585|-1|1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent" value="1585|-1|1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="1040" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent" value="1040|-1|1040" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent" value="1585|-1|1585" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent" value="16|4|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent" value="16|5|48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_for_statement" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent" value="16|-1|16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class" value="20" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent" value="16|5|80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent" value="16|4|48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent" value="16|4|49" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent" value="16|4|48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent" value="16|4|48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent" value="16|4|48" />
+ <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1" />
+ <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2" />
+ <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2" />
+ <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off" />
+ <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on" />
+ <setting id="org.eclipse.jdt.core.formatter.force_if_else_statement_brace" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert" />
+ <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" />
+ <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0" />
+ <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="3" />
+ <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" />
+ <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" />
+ <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
+ <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
+ <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_comment_inline_tags" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation" value="false" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true" />
+ <setting id="org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments" value="false" />
+ </profile>
+</profiles>
\ No newline at end of file
-##### Format code with ktlint checkstyle tool use the following command
-
+### Format code with ktlint checkstyle tool use the following command
`mvn process-sources -P format`
+**Reference:** [ktlint docs](https://ktlint.github.io/) | [ktlint codebase](https://github.com/pinterest/ktlint)
-## Reference
-https://github.com/pinterest/ktlint
-
-## Getting started
-
+## Basic Architecture
![Basic_Architecture](./docs/media/CDS.png)
## Basic Requirements
Before you can build this project, you must install and configure the following dependencies on your machine:
+ 1) Java 11 SDK
+ 2) Maven 3.6.X
+ 3) MySQL Database
+ 4) Node and npm installed
+ 5) Angular CLI & Angular v8
- 1- Java 8 SDK
-
- 2- Node and npm installed
-
- 3- Angular CLI & Angular v8
-
- 4- MySQL Database
-
- 5- maven
-
## Running in Development Mode
-
-* In the main project folder run `mvn clean install` command to install all libraries and dependencies for maven and npm.
-
- 1- Back-end MS
+Running `mvn clean install` command to install all libraries and dependencies for the maven and npm.
+Running `mvn clean install -Pdocker` command to install all libraries and create below docker images.
+ * ccsdk-blueprintsprocessor
+ * ccsdk-commandexecutor
+ * ccsdk-py-executor
+ * ccsdk-sdclistener
+ * ccsdk-cds-ui-server
+ * ccsdk-cds-ui
+
+**Note:** run `mvn clean install -Pdocker -Ddocker.skip.push=true` to build but skip pushing docker image.
+
+1) Back-end MS
+ >Create `sdnctl` table in MySQL<br>
+ >(Optional) You could run the project in a specific profile(dev, local) by adding `-Dspring.profiles.active=profile-name`
- * create `sdnctl` table in MySQL
- * (Optional) You could run the project in a specific profile(dev, local) by adding `-Dspring.profiles.active=profile-name`
-
-2- Loop-back server: that allow your request to reach the backend from cds-ui
- * move to `./cds-ui/server/` folder and run the command `npm start`
-
- 3- cds-ui
+2) Loop-back server:
+ >That allow your request to reach the backend from cds-ui<br>
+ >Move to `./cds-ui/server/` folder and run the command `npm start`
- * move to `./cds-ui/designer-client/` folder and run the command `npm start`, This command will make sure all the files follow the linting rules and then connect to the loopback server.
+3) cds-ui
+ >Move to `./cds-ui/designer-client/` folder and run the command `npm start`<br>
+ >This command will make sure all the files follow the linting rules and then connect to the loopback server.
## Using an IDE
-
-**Front-end** you could use `vscode` or `webstorm`.
-
-**Back-end** `Intellij` with kotlin plugin or any other editor
-
+**Front-end:** you could use `vscode` or `webstorm`<br>
+**Back-end:** `IntelliJ` with kotlin plugin or any other editor
---
-For more information check the `docs` folder.
\ No newline at end of file
+For more information check: [CDS Docs](https://docs.onap.org/projects/onap-ccsdk-cds/en/latest/index.html)
\ No newline at end of file
def versionArray;
-if ( project.properties['ccsdk.project.version'] != null ) {
- versionArray = project.properties['ccsdk.project.version'].split('\\.');
+if ( project.properties['ccsdk.cds.version'] != null ) {
+ versionArray = project.properties['ccsdk.cds.version'].split('\\.');
}
-if ( project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT") ) {
+if ( project.properties['ccsdk.cds.version'].endsWith("-SNAPSHOT") ) {
patchArray = versionArray[2].split('-');
project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest";
project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-latest";
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ui</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
- <artifactId>application</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ui-application</artifactId>
<packaging>pom</packaging>
- <name>CDS UI Application</name>
+ <name>UI Application</name>
<properties>
<image.name>onap/ccsdk-cds-ui</image.name>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <docker.verbose>true</docker.verbose>
</properties>
<build>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.28.0</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
-
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
+ <id>build-push-images</id>
+ <phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
============LICENSE_END============================================ -->
<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>ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>ui-client</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <name>CDS UI Client</name>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <npm.executable>npm</npm.executable>
- <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.github.eirslett</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
- <version>1.3</version>
- <configuration>
- <nodeVersion>v8.12.0</nodeVersion>
- <npmVersion>6.4.1</npmVersion>
- <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
- <installDirectory>./</installDirectory>
- </configuration>
- <executions>
- <execution>
- <id>install node and npm</id>
- <goals>
- <goal>install-node-and-npm</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
-
- <execution>
- <id>npm install</id>
- <goals>
- <goal>npm</goal>
- </goals>
-
- <phase>generate-resources</phase>
-
- <configuration>
- <arguments>install</arguments>
- </configuration>
- </execution>
-
- <execution>
- <id>npm build</id>
- <goals>
- <goal>npm</goal>
- </goals>
-
- <phase>generate-resources</phase>
-
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds</groupId>
+ <artifactId>cds-ui</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>cds-ui-client</artifactId>
+ <packaging>pom</packaging>
+
+ <name>UI Client</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
+ <version>1.3</version>
+ <configuration>
+ <nodeVersion>v8.12.0</nodeVersion>
+ <npmVersion>6.4.1</npmVersion>
+ <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
+ <installDirectory>./</installDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>install node and npm</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
+ <configuration>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>npm build</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
+ <configuration>
+ <arguments>run build</arguments>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
}
}
},
+ "sonar-scanner": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/sonar-scanner/-/sonar-scanner-3.1.0.tgz",
+ "integrity": "sha1-UcHBEB9UuYq8XYVlIJsdkjKXk0M=",
+ "dev": true
+ },
"sort-keys": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
"version": "0.0.0",
"scripts": {
"ng": "ng",
- "start": "npm run lint && ng build --prod --aot && ng serve --proxy-config proxy.conf.json",
+ "start": "npm run lint && ng serve --proxy-config proxy.conf.json && ng build --prod --aot ",
"build": "npm run lint && ng build --prod --aot ",
"test": "ng test",
"lint": "ng lint",
- "e2e": "ng e2e"
+ "e2e": "ng e2e",
+ "sonar": "sonar-scanner"
},
"private": true,
"dependencies": {
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
+ "sonar-scanner": "^3.1.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
============LICENSE_END============================================ -->
<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>ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>designer-client</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <name>CDS designer Client</name>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <npm.executable>npm</npm.executable>
- <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.github.eirslett</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
- <version>1.3</version>
- <configuration>
- <nodeVersion>v13.7.0</nodeVersion>
- <npmVersion>6.13.6</npmVersion>
- <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
- <installDirectory>./</installDirectory>
- </configuration>
- <executions>
- <execution>
- <id>install node and npm</id>
- <goals>
- <goal>install-node-and-npm</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
-
- <execution>
- <id>npm install</id>
- <goals>
- <goal>npm</goal>
- </goals>
-
- <phase>generate-resources</phase>
-
- <configuration>
- <arguments>install</arguments>
- </configuration>
- </execution>
-
- <execution>
- <id>npm build</id>
- <goals>
- <goal>npm</goal>
- </goals>
-
- <phase>generate-resources</phase>
-
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds</groupId>
+ <artifactId>cds-ui</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>cds-ui-designer-client</artifactId>
+ <packaging>pom</packaging>
+
+ <name>UI designer Client</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
+ <version>1.3</version>
+ <configuration>
+ <nodeVersion>v13.7.0</nodeVersion>
+ <npmVersion>6.13.6</npmVersion>
+ <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
+ <installDirectory>./</installDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>install node and npm</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
+ <configuration>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>npm build</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
+ <configuration>
+ <arguments>run build</arguments>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
{
"/controllerblueprint/*": {
- "target": "https://41.128.168.198:3000",
+ "target": "https://localhost:3000",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/resourcedictionary/*": {
- "target": "https://41.128.168.198:3000",
+ "target": "https://localhost:3000",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
--- /dev/null
+sonar.host.url=http://localhost:9000
+sonar.login=admin
+sonar.password=admin
+sonar.projectKey=designer-client-app
+sonar.projectName=designer-client-app
+sonar.projectVersion=1.0
+sonar.sourceEncoding=UTF-8
+sonar.sources=src
+sonar.exclusions=**/node_modules/**
+sonar.tests=src
+sonar.test.inclusions=**/*.spec.ts
+sonar.typescript.lcov.reportPaths=coverage/lcov.info
*/
import {NgModule} from '@angular/core';
-import {Routes, RouterModule} from '@angular/router';
+import {RouterModule, Routes} from '@angular/router';
const routes: Routes = [
- {path: 'packages',
- loadChildren: './modules/feature-modules/packages/packages.module#PackagesModule'},
- {path: 'resource-dictionary',
- loadChildren: './modules/feature-modules/resource-dictionary/resource-dictionary.module#ResourceDictionaryModule'},
+ {
+ path: 'packages',
+ loadChildren: './modules/feature-modules/packages/packages.module#PackagesModule'
+ },
+ {
+ path: 'resource-dictionary',
+ loadChildren: './modules/feature-modules/resource-dictionary/resource-dictionary.module#ResourceDictionaryModule'
+ },
// { path: '', component: MainAppComponent },
{
path: '',
];
@NgModule({
- imports: [RouterModule.forRoot(routes)],
+ imports: [RouterModule.forRoot(routes, {useHash: true})],
exports: [RouterModule]
})
export class AppRoutingModule {
--- /dev/null
+import {HostListener} from '@angular/core';
+
+export abstract class ComponentCanDeactivate {
+
+ abstract canDeactivate(): boolean;
+
+
+ @HostListener('window:beforeunload', ['$event'])
+ unloadNotification($event: any) {
+ if (this.canDeactivate()) {
+ $event.returnValue = true;
+ }
+ }
+}
--- /dev/null
+import {Injectable} from '@angular/core';
+
+import {CanDeactivate} from '@angular/router';
+import {ComponentCanDeactivate} from './ComponentCanDeactivate';
+
+@Injectable()
+export class ComponentCanDeactivateGuard implements CanDeactivate<ComponentCanDeactivate> {
+ canDeactivate(component: ComponentCanDeactivate): boolean {
+
+ if (component.canDeactivate()) {
+ if (confirm('You have unsaved changes! If you leave, your changes will be lost.')) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+}
return this.httpClient.post(url, body, options);
}
+
+ getCustomized(url: string, params?: any): Observable<any> {
+ return this.httpClient.get(url, params);
+ }
}
protected setState(nextState: T): void {
console.log('setting state', this.subject);
this.subject.next(nextState);
+ console.log('current state', this.subject);
}
public unsubscribe() {
</h2>
<div class="col profile-help">
<nav class="navbar navbar-expand-lg navbar-light">
- <ul class="navbar-nav ml-auto">
- <!-- <li class="nav-item help-btn">
- <a class="nav-link mr-2" href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank"
- [delay]="300" tooltip="Help" placement="bottom"><i class="icon-info" aria-hidden="true"></i></a>
- </li> -->
- <!--Help Menu-->
- <div class="nav-item dropdown helpMenu">
- <input class="dropdown-toggle" type="text">
- <div class="dropdown-text"><i class="icon-info" aria-hidden="true"></i></div>
- <ul class="dropdown-content">
- <!-- <li>
- <i class="icon-get_started" aria-hidden="true"></i>
- <p>
- <input id="clicker3" [checked]="startTour" type="checkbox" />
- <label for="clicker">
- Getting Started
- <span>Quick steps to help you get started</span>
- </label>
- </p>
+ <ul class="navbar-nav ml-auto">
+ <!-- <li class="nav-item help-btn">
+ <a class="nav-link mr-2" href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank"
+ [delay]="300" tooltip="Help" placement="bottom"><i class="icon-info" aria-hidden="true"></i></a>
</li> -->
- <li>
- <a href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank">
- <i class="icon-user_guide" aria-hidden="true"></i>
- <p>
- Tutorials
- <span>CDS Designer's User Guide</span>
- </p>
- </a>
- </li>
- </ul>
- </div>
- <!--User Menu-->
- <div class="nav-item dropdown userMenu">
- <input class="dropdown-toggle" type="text">
- <div class="dropdown-text"><img src="../assets/img/img-user.jpeg" align="right"></div>
- <ul class="dropdown-content">
- <li>
- <a href="#">Username</a>
- </li>
- <li>
- <a href="#">Settings</a>
- </li>
- <li>
- <a href="#">Projects</a>
- </li>
- <li>
- <a href="#">Log out</a>
- </li>
- </ul>
- </div>
+ <!--Help Menu-->
+ <div class="nav-item dropdown helpMenu">
+ <input class="dropdown-toggle" type="text">
+ <div class="dropdown-text"><i class="icon-info" aria-hidden="true"></i></div>
+ <ul class="dropdown-content">
+ <li>
+ <i class="icon-get_started" aria-hidden="true"></i>
+ <p>
+ <input id="clicker3" type="checkbox"/>
+ <label for="clicker">
+ Getting Started
+ <span>Quick steps to help you get started</span>
+ </label>
+ </p>
+ </li>
+ <!-- <li>
+ <i class="icon-get_started" aria-hidden="true"></i>
+ <p>
+ <input id="clicker3" [checked]="startTour" type="checkbox" />
+ <label for="clicker">
+ Getting Started
+ <span>Quick steps to help you get started</span>
+ </label>
+ </p>
+ </li> -->
+ <li>
+ <a href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank">
+ <i class="icon-user_guide" aria-hidden="true"></i>
+ <p>
+ Tutorials
+ <span>CDS Designer's User Guide</span>
+ </p>
+ </a>
+ </li>
+ </ul>
+ </div>
+ <!--User Menu-->
+ <div class="nav-item dropdown userMenu">
+ <input class="dropdown-toggle" type="text">
+ <div class="dropdown-text"><img src="../assets/img/img-user.jpeg" align="right"></div>
+ <ul class="dropdown-content">
+ <li>
+ <a href="#">Username</a>
+ </li>
+ <li>
+ <a href="#">Settings</a>
+ </li>
+ <li>
+ <a href="#">Projects</a>
+ </li>
+ <li>
+ <a href="#">Log out</a>
+ </li>
+ </ul>
+ </div>
- </ul>
+ </ul>
</nav>
- </div>
+ </div>
</div>
</header>
<span>Download</span>
</a>
- <a data-target="#removePackageModal" data-toggle="modal" class="action-button">
+ <a data-target="#removePackageModal" data-toggle="modal" class="action-button delete">
<i class="icon-delete-sm" aria-hidden="true"></i>
<span>Delete</span>
</a>
<div class="row package-auth-info">
<div class="col-3">
<p><b>Author Name</b></p>
- <span> {{viewedPackage.updatedBy ? viewedPackage.updatedBy.split('<')[0] : ""}}</span>
+ <span>
+ {{viewedPackage.updatedBy ? viewedPackage.updatedBy.split('<')[0] : ""}}</span>
</div>
<!--<div class="col-4">
<p><b>Author Email</b></p>
</button> -->
<!-- Button trigger modal - 1st Action -->
- <button type="button" class="btn btn-sm btn-primary mb-2" data-toggle="modal"
- data-target="#exampleModalLong">
+ <button (click)="checkSkipTypesOfAction()" type="button" class="btn btn-sm btn-primary mb-2"
+ data-toggle="modal" [attr.data-target]="dataTarget">
<i class="icon-topologyView-active"></i> Designer Mode
</button>
<!-- Designer Modal -->
</div>
<div class="row">
<div class="col text-center">
- <button class="btn skip-btn"
+ <button class="btn skip-btn" data-dismiss="modal"
(click)="goToDesignerMode(viewedPackage.id)">
Skip
to Designer Canvas
<input type="text" [(ngModel)]="customActionName"
class="form-control customAction"
placeholder="Type Action Name" autofocus>
- <button type="button"
+ <button type="button" data-dismiss="modal"
(click)="goToDesignerMode(viewedPackage.id)"
class="btn submit">Start
</button>
<div class="row">
<div class="col text-center">
<p class="selectedActions">0 selected</p>
- <button type="button"
+ <button type="button" data-dismiss="modal"
(click)="goToDesignerMode(viewedPackage.id)"
class="btn submit">Start
</button>
<div class="row">
<div class="col text-center">
<p class="selectedActions">0 selected</p>
- <button type="button"
- class="btn submit">Start
+ <button type="button" class="btn submit">Start
</button>
</div>
</div>
</div>
<div class="row">
<div class="col text-center">
- <button type="button"
- class="btn submit mt-4">Import
+ <button type="button" class="btn submit mt-4">Import
</button>
</div>
</div>
<div class="col">
<div class="tab-content" id="nav-tabContent" (change)="clickEvent()">
<div class="tab-pane fade show active" id="nav-metadata" role="tabpanel"
- aria-labelledby="nav-metadata-tab" >
+ aria-labelledby="nav-metadata-tab">
<app-metadata-tab></app-metadata-tab>
</div>
<div class="tab-pane fade" id="nav-template" role="tabpanel"
<li>1. Copy and paste "workflows" and "node_templates"</li>
<li>2. Press <b>Enrich</b> button</li>
</ul>
- <ace-editor [(text)]="vlbDefinition.topology_template.content" [mode]="'javascript'"
- [autoUpdateContent]="true"
- [durationBeforeCallback]="1000" (textChanged)="textChanged($event)" [theme]="'eclipse'"
- #editor
- style="height:300px;">
+ <ace-editor [(text)]="this.vlbDefinition.topology_template.content" [mode]="'json'"
+ [autoUpdateContent]="true" [durationBeforeCallback]="1000" [theme]="'eclipse'"
+ (textChanged)="textChanged($event)"
+ #editor style="height:300px;">
</ace-editor>
</div>
<div class="modal-footer">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
- <button type="button" (click)="deletePackage()" data-dismiss="modal"
- class="btn btn-primary">Delete
+ <button type="button" (click)="deletePackage()" data-dismiss="modal" class="btn btn-primary">Delete
</button>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
- <button type="button" (click)="discardChanges()" data-dismiss="modal"
- class="btn btn-primary">Discard Changes
+ <button type="button" (click)="discardChanges()" data-dismiss="modal" class="btn btn-primary">Discard
+ Changes
</button>
</div>
</div>
-import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
+import {Component, ElementRef, OnDestroy, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
import {PackageCreationStore} from '../package-creation/package-creation.store';
-import {FilesContent, FolderNodeElement, MetaDataTabModel} from '../package-creation/mapping-models/metadata/MetaDataTab.model';
+import {FilesContent, FolderNodeElement} from '../package-creation/mapping-models/metadata/MetaDataTab.model';
import {MetadataTabComponent} from '../package-creation/metadata-tab/metadata-tab.component';
import * as JSZip from 'jszip';
import {ConfigurationDashboardService} from './configuration-dashboard.service';
import {TemplateTopology, VlbDefinition} from '../package-creation/mapping-models/definitions/VlbDefinition';
-import {DslDefinition} from '../package-creation/mapping-models/CBAPacakge.model';
+import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model';
import {PackageCreationUtils} from '../package-creation/package-creation.utils';
import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes';
import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder';
import {DesignerStore} from '../designer/designer.store';
import {ToastrService} from 'ngx-toastr';
import {NgxFileDropEntry} from 'ngx-file-drop';
+import {PackageCreationService} from '../package-creation/package-creation.service';
+import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate';
+import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service';
+import {distinctUntilChanged, takeUntil} from 'rxjs/operators';
+import {Subject} from 'rxjs';
@Component({
selector: 'app-configuration-dashboard',
templateUrl: './configuration-dashboard.component.html',
styleUrls: ['./configuration-dashboard.component.css'],
})
-export class ConfigurationDashboardComponent implements OnInit {
+export class ConfigurationDashboardComponent extends ComponentCanDeactivate implements OnInit, OnDestroy {
viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
@ViewChild(MetadataTabComponent, {static: false})
metadataTabComponent: MetadataTabComponent;
isSaveEnabled = false;
versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$';
metadataClasses = 'nav-item nav-link active';
+ private cbaPackage: CBAPackage = new CBAPackage();
+ dataTarget: any = '';
+ ngUnsubscribe = new Subject();
+ private designerState: any;
constructor(
private route: ActivatedRoute,
private configurationDashboardService: ConfigurationDashboardService,
private packageCreationStore: PackageCreationStore,
+ private packageCreationService: PackageCreationService,
private packageCreationUtils: PackageCreationUtils,
private router: Router,
private designerStore: DesignerStore,
- private toastService: ToastrService
+ private toastService: ToastrService,
+ private packageCreationExtractionService: PackageCreationExtractionService
) {
+ super();
+
+
}
ngOnInit() {
this.vlbDefinition.topology_template = new TemplateTopology();
-
+ this.packageCreationStore.state$
+ .pipe(distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(
+ cbaPackage => {
+ this.cbaPackage = cbaPackage;
+ });
+ this.designerStore.state$.pipe(
+ distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(state => {
+ this.designerState = state;
+ this.vlbDefinition.topology_template.content = this.packageCreationUtils.transformToJson(state.template);
+ });
this.elementRef.nativeElement.focus();
this.refreshCurrentPackage();
const regexp = RegExp(this.versionPattern);
- this.packageCreationStore.state$.subscribe(
- cbaPackage => {
- if (cbaPackage && cbaPackage.metaData && cbaPackage.metaData.description
- && cbaPackage.metaData.name && cbaPackage.metaData.version &&
- regexp.test(cbaPackage.metaData.version)) {
- if (!this.metadataClasses.includes('complete')) {
- this.metadataClasses += ' complete';
- }
- } else {
- this.metadataClasses = this.metadataClasses.replace('complete', '');
- this.isSaveEnabled = false;
- }
+ if (this.cbaPackage && this.cbaPackage.metaData && this.cbaPackage.metaData.description
+ && this.cbaPackage.metaData.name && this.cbaPackage.metaData.version &&
+ regexp.test(this.cbaPackage.metaData.version)) {
+ if (!this.metadataClasses.includes('complete')) {
+ this.metadataClasses += ' complete';
+ }
+ } else {
+ this.metadataClasses = this.metadataClasses.replace('complete', '');
+ this.isSaveEnabled = false;
+ }
+
- });
}
- private refreshCurrentPackage() {
+ private refreshCurrentPackage(id?) {
this.id = this.route.snapshot.paramMap.get('id');
- this.configurationDashboardService.getPagedPackages(this.id).subscribe(
+ console.log(this.id);
+ id = id ? id : this.id;
+ this.configurationDashboardService.getPagedPackages(id).subscribe(
(bluePrintDetailModels) => {
if (bluePrintDetailModels) {
this.viewedPackage = bluePrintDetailModels[0];
private downloadCBAPackage(bluePrintDetailModels: BluePrintDetailModel) {
this.configurationDashboardService.downloadResource(
- bluePrintDetailModels[0].artifactName + '/' + bluePrintDetailModels[0].artifactVersion).subscribe(response => {
+ this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion).subscribe(response => {
const blob = new Blob([response], {type: 'application/octet-stream'});
this.currentBlob = blob;
- this.extractBlobToStore(blob, bluePrintDetailModels);
- });
- }
-
- private extractBlobToStore(blob: Blob, bluePrintDetailModels: BluePrintDetailModel) {
- this.zipFile.loadAsync(blob).then((zip) => {
- Object.keys(zip.files).forEach((filename) => {
- zip.files[filename].async('string').then((fileData) => {
- console.log(filename);
- if (fileData) {
- if (filename.includes('Scripts/')) {
- this.setScripts(filename, fileData);
- } else if (filename.includes('Templates/')) {
- if (filename.includes('-mapping.')) {
- this.setMapping(filename, fileData);
- } else if (filename.includes('-template.')) {
- this.setTemplates(filename, fileData);
- }
-
- } else if (filename.includes('Definitions/')) {
- this.setImports(filename, fileData, bluePrintDetailModels);
- } else if (filename.includes('TOSCA-Metadata/')) {
- const metaDataTabInfo: MetaDataTabModel = this.getMetaDataTabInfo(fileData);
- this.setMetaData(metaDataTabInfo, bluePrintDetailModels[0]);
- }
- }
- });
- });
+ this.packageCreationExtractionService.extractBlobToStore(blob);
});
}
- setScripts(filename: string, fileData: any) {
- this.packageCreationStore.addScripts(filename, fileData);
- }
-
- setImports(filename: string, fileData: any, bluePrintDetailModels: BluePrintDetailModel) {
- if (filename.includes(bluePrintDetailModels[0].artifactName)) {
- let definition = new VlbDefinition();
- definition = fileData as VlbDefinition;
- definition = JSON.parse(fileData);
- const dslDefinition = new DslDefinition();
- dslDefinition.content = this.packageCreationUtils.transformToJson(definition.dsl_definitions);
- const mapOfCustomKeys = new Map<string, string>();
- for (const metadataKey in definition.metadata) {
- if (!this.entryDefinitionKeys.includes(metadataKey + '')) {
- mapOfCustomKeys.set(metadataKey + '', definition.metadata[metadataKey + '']);
- }
- }
- this.packageCreationStore.changeDslDefinition(dslDefinition);
- this.packageCreationStore.setCustomKeys(mapOfCustomKeys);
- if (definition.topology_template && definition.topology_template.content) {
- this.designerStore.saveSourceContent(definition.topology_template.content);
- }
-
- }
- this.packageCreationStore.addDefinition(filename, fileData);
-
- }
-
- setTemplates(filename: string, fileData: any) {
- this.packageCreationStore.addTemplate(filename, fileData);
- }
-
- setMapping(fileName: string, fileData: string) {
- this.packageCreationStore.addMapping(fileName, fileData);
- }
-
editBluePrint() {
- this.packageCreationStore.state$.subscribe(
- cbaPackage => {
- FilesContent.clear();
- let packageCreationModes: PackageCreationModes;
- cbaPackage = PackageCreationModes.mapModeType(cbaPackage);
- cbaPackage.metaData = PackageCreationModes.setEntryPoint(cbaPackage.metaData);
- packageCreationModes = PackageCreationBuilder.getCreationMode(cbaPackage);
- packageCreationModes.execute(cbaPackage, this.packageCreationUtils);
- this.filesData.push(this.folder.TREE_DATA);
- this.saveBluePrintToDataBase();
- });
- }
+ this.configurationDashboardService.deletePackage(this.viewedPackage.id).subscribe(res => {
+ this.formTreeData();
+ this.saveBluePrintToDataBase();
- setMetaData(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BluePrintDetailModel) {
- metaDataObject.description = bluePrintDetailModel.artifactDescription;
- this.packageCreationStore.changeMetaData(metaDataObject);
+ });
+ }
+ private formTreeData() {
+ FilesContent.clear();
+ let packageCreationModes: PackageCreationModes;
+ this.cbaPackage = PackageCreationModes.mapModeType(this.cbaPackage);
+ this.cbaPackage.metaData = PackageCreationModes.setEntryPoint(this.cbaPackage.metaData);
+ packageCreationModes = PackageCreationBuilder.getCreationMode(this.cbaPackage);
+ packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils);
+ this.filesData.push(this.folder.TREE_DATA);
}
saveMetaData() {
this.metadataTabComponent.saveMetaDataToStore();
-
- }
-
- getMetaDataTabInfo(fileData: string) {
- const metaDataTabModel = new MetaDataTabModel();
- const arrayOfLines = fileData.split('\n');
- metaDataTabModel.entryFileName = arrayOfLines[3].split(':')[1];
- metaDataTabModel.name = arrayOfLines[4].split(':')[1];
- metaDataTabModel.version = arrayOfLines[5].split(':')[1];
- metaDataTabModel.mode = arrayOfLines[6].split(':')[1];
- metaDataTabModel.templateTags = new Set<string>(arrayOfLines[7].split(':')[1].split(','));
- return metaDataTabModel;
}
saveBluePrintToDataBase() {
this.create();
this.zipFile.generateAsync({type: 'blob'})
.then(blob => {
- this.packageCreationStore.saveBluePrint(blob).subscribe(
+ this.packageCreationService.savePackage(blob).subscribe(
bluePrintDetailModels => {
if (bluePrintDetailModels) {
const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
this.toastService.info('package updated successfully ');
+ this.isSaveEnabled = false;
this.router.navigate(['/packages/package/' + id]);
+ this.refreshCurrentPackage(id);
}
}, error => {
this.toastService.error('error happened when editing ' + error.message);
this.configurationDashboardService.deletePackage(this.id).subscribe(res => {
console.log('Deleted');
console.log(res);
+ this.isSaveEnabled = false;
this.router.navigate(['/packages']);
}, err => {
console.log(err);
}
deployCurrentPackage() {
- this.collectZipFileFromStore();
+ this.formTreeData();
this.deployPackage();
}
goToDesignerMode(id) {
- // this.designerService.setActionName(this.customActionName);
this.router.navigate(['/packages/designer', id, {actionName: this.customActionName}]);
}
}
textChanged($event: {}) {
- this.packageCreationStore.addTopologyTemplate(this.vlbDefinition.topology_template);
+ this.cbaPackage.templateTopology.node_templates = this.designerState.template.node_templates;
+ this.cbaPackage.templateTopology.workflows = this.designerState.template.workflows;
+ this.cbaPackage.templateTopology.content = this.vlbDefinition.topology_template.content;
}
enrichBluePrint() {
-
- this.collectZipFileFromStore();
+ this.packageCreationStore.addTopologyTemplate(this.cbaPackage.templateTopology);
+ this.formTreeData();
this.enrichPackage();
+ this.designerStore.clear();
+ this.packageCreationStore.clear();
}
- private collectZipFileFromStore() {
- this.packageCreationStore.state$.subscribe(
- cbaPackage => {
- FilesContent.clear();
- console.log(cbaPackage);
- let packageCreationModes: PackageCreationModes;
- cbaPackage = PackageCreationModes.mapModeType(cbaPackage);
- cbaPackage.metaData = PackageCreationModes.setEntryPoint(cbaPackage.metaData);
- packageCreationModes = PackageCreationBuilder.getCreationMode(cbaPackage);
- packageCreationModes.execute(cbaPackage, this.packageCreationUtils);
- this.filesData.push(this.folder.TREE_DATA);
- });
- }
private enrichPackage() {
this.create();
this.zipFile.generateAsync({type: 'blob'})
.then(blob => {
- this.packageCreationStore.enrichBluePrint(blob).subscribe(response => {
+ this.packageCreationService.enrichPackage(blob).subscribe(response => {
console.log('success');
const blobInfo = new Blob([response], {type: 'application/octet-stream'});
- this.configurationDashboardService.getPagedPackages(this.id).subscribe(
- (bluePrintDetailModels) => {
- if (bluePrintDetailModels) {
- this.packageCreationStore.clear();
- this.extractBlobToStore(blob, bluePrintDetailModels);
- this.isSaveEnabled = true;
- this.toastService.info('enriched successfully ');
- }
- });
-
- // saveAs(blobInfo, 'test' + '-' + '1.0.0' + '-CBA.zip');
-
+ this.currentBlob = blobInfo;
+ this.packageCreationStore.clear();
+ this.packageCreationExtractionService.extractBlobToStore(this.currentBlob);
+ this.isSaveEnabled = true;
+ this.toastService.info('enriched successfully ');
});
}, error => {
- this.toastService.error('error happened when editing ' + error.message);
- console.log('Error -' + error.message);
+ this.toastService.error('error happened when enrich ' + error.message);
+ console.error('Error -' + error.message);
});
}
this.create();
this.zipFile.generateAsync({type: 'blob'})
.then(blob => {
- this.packageCreationStore.deployBluePrint(blob).subscribe(response => {
- console.log('success');
- console.log(response);
-
- // saveAs(blobInfo, 'test' + '-' + '1.0.0' + '-CBA.zip');
-
+ this.packageCreationService.deploy(blob).subscribe(response => {
+ this.toastService.info('deployed successfully ');
+ const id = response.toString().split('id')[1].split(':')[1].split('"')[1];
+ this.isSaveEnabled = false;
+ this.router.navigate(['/packages/package/' + id]);
});
}, error => {
this.toastService.error('error happened when deploying ' + error.message);
clickEvent() {
this.isSaveEnabled = true;
}
+
+ canDeactivate(): boolean {
+ return this.isSaveEnabled;
+ }
+
+ ngOnDestroy() {
+ this.ngUnsubscribe.next();
+ this.ngUnsubscribe.complete();
+ }
+
+ checkSkipTypesOfAction() {
+ console.log(this.cbaPackage);
+ if (this.cbaPackage.templateTopology && this.cbaPackage.templateTopology.node_templates
+ && this.cbaPackage.templateTopology.workflows) {
+ this.goToDesignerMode(this.id);
+ } else {
+ this.dataTarget = '#exampleModalLong';
+ }
+ }
}
+
--- /dev/null
+<div class="scrollWrapper">
+ <div class="row m-0">
+ <div class="col">
+ <div class="form-group">
+ <label for="exampleInputEmail1">Action Name</label>
+ <input type="text" class="form-control" placeholder="Action Name"
+ value="resource-assignment">
+ </div>
+ </div>
+ </div>
+ <!--Add Attribute-->
+ <div class="row m-b add-attribute">
+ <div class="col">
+ <h5>Add Attribute</h5>
+ <div class="row">
+ <div class="col pr-0 text-center">
+ <button type="button" data-toggle="modal" data-target="#exampleModalScrollable"
+ class="btn btn-secondary"><i class="icon-custom-attribute" type="button"
+ aria-hidden="true"></i></button>
+ <span>Custom Attribute</span>
+
+
+ </div>
+ <div class="col text-center">
+ <button type="button" class="btn btn-secondary"><i class="icon-function-attribute"
+ type="button" aria-hidden="true"></i></button>
+ <span>Function Attribute</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!--INPUTS-->
+ <div class="accordion" id="accordionExample">
+ <div class="card">
+ <div class="card-header row" id="headingOne">
+ <button class="btn btn-link" type="button" data-toggle="collapse"
+ data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
+ Inputs
+ </button>
+ </div>
+ <div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
+ data-parent="#accordionExample">
+ <div class="card-body action-attributes">
+ <div class="row">
+ <div class="col">
+ <div class="form-group" *ngFor="let input of inputs">
+ <label for="exampleFormControlTextarea1">{{input.name}}
+ <i [hidden]="!input.required" class="icon-required-star"
+ type="button" aria-hidden="true"></i>
+ <i [hidden]="input.required" type="button" aria-hidden="true"></i>
+ </label>
+ <div class="attributeOptions">
+ <a data-toggle="modal" data-target="#exampleModalScrollable2"
+ class="accordion-delete editAttribute"
+ tooltip="Edit Attribute" placement="bottom"><i
+ class="icon-edit"></i></a>
+ <a class="accordion-delete deleteAttribute"
+ tooltip="Delete Attribute" placement="bottom"><i
+ class="icon-delete-sm"></i></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!--OUTPUTS-->
+ <div class="accordion" id="accordionExample1">
+ <div class="card">
+ <div class="card-header row" id="headingOne">
+ <button class="btn btn-link" type="button" data-toggle="collapse"
+ data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
+ Outputs
+ </button>
+ </div>
+
+ <div id="collapseTwo" class="collapse show" aria-labelledby="headingOne"
+ data-parent="#accordionExample1">
+ <div class="card-body">
+ <div class="row">
+ <div class="col">
+ <div class="form-group" *ngFor="let output of outputs">
+ <label for="exampleFormControlTextarea1">{{output.name}}
+ <i [hidden]="output.required"
+ class="icon-required-star optional-attribute" type="button"
+ aria-hidden="true"></i>
+ <i [hidden]="output.required" class="optional-attribute"
+ type="button" aria-hidden="true"></i>
+ </label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<!--Action - Add Custom Attribute - Modal-->
+<div class="modal fade" id="exampleModalScrollable" tabindex="-1" role="dialog"
+ aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
+ <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="exampleModalScrollableTitle">
+ Add Custom Attributes</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <img src="assets/img/icon-close.svg"/>
+ </button>
+ </div>
+ <div class="modal-body createAttributeTabs">
+ <!--Action - Inputs & Outputs Attribute-->
+ <ul class="nav nav-tabs" id="myTab" role="tablist">
+ <li class="nav-item">
+ <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab"
+ aria-controls="home" aria-selected="true">Inputs</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab"
+ aria-controls="profile" aria-selected="false">Outputs</a>
+ </li>
+ </ul>
+ <div class="tab-content" id="myTabContent">
+ <!--INPUTS Tab-->
+ <div class="tab-pane fade show active create-form" id="home" role="tabpanel"
+ aria-labelledby="home-tab">
+ <div class="form-group row">
+ <label for="inputEmail3" class="col-sm-3 col-form-label">Name <span>*</span></label>
+ <div class="col-sm-9">
+ <input [(ngModel)]="inputActionAttribute.name" type="email" class="form-control"
+ id="inputEmail3" placeholder="Attribute name">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label for="inputPassword3" class="col-sm-3 col-form-label">Description</label>
+ <div class="col-sm-9">
+ <input [(ngModel)]="inputActionAttribute.description" type="text" class="form-control"
+ id="inputPassword3"
+ placeholder="Add some description">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Type <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="list-group list-group-horizontal">
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setInputType('String')">
+ String
+ </button>
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setInputType('Integer')">Integer
+ </button>
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setInputType('Boolean')">Boolean
+ </button>
+ <button type="button" class="list-group-item list-group-item-action"
+ (click)="setInputType('List')">List
+ </button>
+ <button type="button" class="list-group-item list-group-item-action"
+ (click)="setInputType('Other')">Other
+ </button>
+
+ </div>
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Required <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline1" name="customRadioInline1"
+ class="custom-control-input" (click)="setInputRequired(true)">
+ <label class="custom-control-label" for="customRadioInline1">True</label>
+ </div>
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline2" name="customRadioInline1"
+ class="custom-control-input" (click)="setInputRequired(false)">
+ <label class="custom-control-label" for="customRadioInline2">False</label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!--OUTPUTS Tab-->
+ <div class="tab-pane fade create-form" id="profile" role="tabpanel" aria-labelledby="profile-tab">
+ <div class="form-group row">
+ <label for="inputEmail3" class="col-sm-3 col-form-label">Name <span>*</span></label>
+ <div class="col-sm-9">
+ <input [(ngModel)]="outputActionAttribute.name" type="email" class="form-control"
+ id="inputEmail3" placeholder="Attribute name">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label for="inputPassword3" class="col-sm-3 col-form-label">Description</label>
+ <div class="col-sm-9">
+ <input [(ngModel)]="outputActionAttribute.description"
+ type="text" class="form-control" id="inputPassword3"
+ placeholder="Add some description">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Type <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="list-group list-group-horizontal">
+ <button type="button" class="list-group-item list-group-item-action">String</button>
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setOutputType('Integer')">
+ Integer
+ </button>
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setOutputType('Boolean')">
+ Boolean
+ </button>
+ <button type="button" class="list-group-item list-group-item-action"
+ (click)="setOutputType('List')">
+ List
+ </button>
+ <button type="button"
+ class="list-group-item list-group-item-action"
+ (click)="setOutputType('Other')">
+ Other
+ </button>
+ </div>
+ <input type="text" class="form-control mt-2 mb-2" id="inputPassword3"
+ placeholder="Add Other type name">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Required <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline1" name="customRadioInline1"
+ class="custom-control-input" (click)="setOutputRequired(true)">
+ <label class="custom-control-label" for="customRadioInline1">True</label>
+ </div>
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline2" name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label" for="customRadioInline2"
+ (click)="setOutputRequired(false)">False</label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-primary" (click)="submitAttributes()">Submit Attributes</button>
+ </div>
+ </div>
+ </div>
+</div>
+<!--Delete Action - Modal-->
+<div class="modal fade" id="exampleModalScrollable1" tabindex="-1" role="dialog"
+ aria-labelledby="exampleModalScrollableTitle1" aria-hidden="true">
+ <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="exampleModalScrollableTitle1">
+ Delete Action</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <img src="assets/img/icon-close.svg"/>
+ </button>
+ </div>
+ <div class="modal-body">
+ Are you sure you want to delete <b>resource-assignment</b> action?
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-primary">Delete</button>
+ </div>
+ </div>
+ </div>
+</div>
+<!--Action - Edit Custom Attribute - Modal-->
+<div class="modal fade" id="exampleModalScrollable2" tabindex="-1" role="dialog"
+ aria-labelledby="exampleModalScrollableTitle2" aria-hidden="true">
+ <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="exampleModalScrollableTitle2">
+ Edit Custom Attributes</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <img src="assets/img/icon-close.svg"/>
+ </button>
+ </div>
+ <div class="modal-body createAttributeTabs">
+ <div class="create-form">
+ <div class="form-group row">
+ <label for="inputEmail3" class="col-sm-3 col-form-label">Name <span>*</span></label>
+ <div class="col-sm-9">
+ <input type="email" class="form-control" id="inputEmail3" placeholder="Attribute name"
+ value="resource-assignment-properties">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label for="inputPassword3" class="col-sm-3 col-form-label">Description</label>
+ <div class="col-sm-9">
+ <input type="text" class="form-control" id="inputPassword3"
+ placeholder="Add some description"
+ value="Dynamic PropertyDefinition for workflow(resource-assignment).">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Type <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="list-group list-group-horizontal">
+ <button type="button"
+ class="list-group-item list-group-item-action">String
+ </button>
+ <button type="button" class="list-group-item list-group-item-action">Integer</button>
+ <button type="button" class="list-group-item list-group-item-action">Boolean</button>
+ <button type="button" class="list-group-item list-group-item-action">List</button>
+ <button type="button" class="list-group-item list-group-item-action active">Other
+ </button>
+ </div>
+ <input type="text" class="form-control mt-2 mb-2" id="inputPassword3"
+ placeholder="Add Other type name" value="dt-resource-assignment-properties">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-form-label col-sm-3 pt-0">Required <span>*</span></label>
+ <div class="col-sm-9">
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline1" name="customRadioInline1"
+ class="custom-control-input" checked>
+ <label class="custom-control-label" for="customRadioInline1">True</label>
+ </div>
+ <div class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline2" name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label" for="customRadioInline2">False</label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-primary">Save</button>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ActionAttributesComponent } from './action-attributes.component';
+
+describe('ActionAttributesComponent', () => {
+ let component: ActionAttributesComponent;
+ let fixture: ComponentFixture<ActionAttributesComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ActionAttributesComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ActionAttributesComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import {Component, OnInit} from '@angular/core';
+import {InputActionAttribute, OutputActionAttribute} from './models/InputActionAttribute';
+
+@Component({
+ selector: 'app-action-attributes',
+ templateUrl: './action-attributes.component.html',
+ styleUrls: ['./action-attributes.component.css']
+})
+export class ActionAttributesComponent implements OnInit {
+
+ inputs = [];
+ outputs = [];
+ actionAttributesSideBar: boolean;
+ inputActionAttribute = new InputActionAttribute();
+ outputActionAttribute = new OutputActionAttribute();
+
+ constructor() {
+
+ }
+
+ ngOnInit() {
+ }
+
+ _toggleSidebar2() {
+ this.actionAttributesSideBar = !this.actionAttributesSideBar;
+ }
+
+ addInput(input: InputActionAttribute) {
+ this.inputs.push(input);
+ }
+
+ addOutput(output: OutputActionAttribute) {
+ this.outputs.push(output);
+ }
+
+ setInputType(type) {
+ this.inputActionAttribute.type = type;
+ }
+
+ setInputRequired(isRequired) {
+ this.inputActionAttribute.required = isRequired;
+ }
+
+ setOutputRequired(isRequired) {
+ this.outputActionAttribute.required = isRequired;
+ }
+
+ setOutputType(type) {
+ this.outputActionAttribute.type = type;
+ }
+
+ submitAttributes() {
+ console.log(this.inputActionAttribute);
+ console.log(this.outputActionAttribute);
+ this.inputs.push(this.inputActionAttribute);
+ this.outputs.push(this.outputActionAttribute);
+ }
+}
--- /dev/null
+export class InputActionAttribute {
+ name: string;
+ description: string;
+ type: string;
+ required: boolean;
+
+ constructor() {
+ this.name = '';
+ this.description = '';
+ this.type = '';
+ this.required = false;
+ }
+}
+
+export class OutputActionAttribute extends InputActionAttribute {
+
+}
font-size: 11px;
line-height: 20px;
}
-
+.save-blueprint li:hover{
+ cursor: pointer;
+}
.componentContainer p{
font-size: 12px;
}
-.functionAttributeSidebar{
+.attributeSidebar{
width: 440px;
padding: 0px;
margin-top: 45px;
}
-.functionAttributeSidebar .attributesContainer{
+.attributesContainer{
+ padding: 0;
background: #fff;
border: solid 1px #C1CDDD;
box-shadow: 0 2px 6px rgba(47, 83, 151, .1);
}
/*ATTRIBUTES SIDE BAR*/
.attributesSideBar{
- width: 396px;
+ width: 358px;
padding: 0px;
- margin-top: 50px;
+ margin-top: 45px;
}
.attributesSideBar .attributesContainer{
+ height: 85.9vh;
+ overflow-y: hidden;
+ padding-bottom: 20px;
background: #fff;
border: solid 1px #C1CDDD;
box-shadow: 0 2px 6px rgba(47, 83, 151, .1);
}
.closeBar{
float: left;
- width: 50%;
- height: 42px;
- background: url(/assets/img/icon-close.svg) center center #DCE8F4 no-repeat ;
+ padding: 0 !important;
+ width: 38px;
+ height: 35px;
+ background:#D9E3EE;
border: 0;
outline: 0;
- margin-left: -30px;
}
.closeBar:focus{
outline: none;
}
+.attributesContainer .scrollWrapper{
+ overflow-y: auto;
+ height: 79vh;
+}
+.attributesContainer .nav-link{
+ padding-top: 7px !important;
+ padding-bottom: 7px !important;
+ color: #1B3E6F !important;
+ text-transform: capitalize !important;
+ border: solid 1px #ECEDF2 !important;
+ border-radius: 0 !important;
+}
+.attributesContainer .nav-item:first-child a{
+ border-top-left-radius: 4px !important;
+ border-bottom-left-radius: 4px !important;
+ border-right-width: 0 !important;
+}
+.attributesContainer .nav-item:last-child a{
+ border-top-right-radius: 4px !important;
+ border-bottom-right-radius: 4px !important;
+ border-left-width: 0 !important;
+}
+.nav-pills .nav-link.active{
+ background-color: #1B3E6F;
+ color: #fff !important;
+}
.attributesContainer h1{
margin-bottom: 10px;
padding: 12px 0 12px 15px;
text-transform: uppercase;
color: #1B3E6F;
}
+.attributesContainertTitle{
+ height: 35px;
+ margin-bottom: 9px !important;
+ padding: 0;
+ background: #DEE8F3;
+ font-size: 12px;
+}
+.add-attribute{
+ margin: 15px 0;
+ padding: 15px 9px;
+ background-color: #F4F9FE;
+}
+.add-attribute h5{
+ padding: 0;
+ margin-bottom: 12px;
+ font-size: 12px;
+ font-weight: bold;
+ text-transform: uppercase;
+ color: #1B3E6F;
+}
+.add-attribute .btn{
+ width: 100%;
+ background-color: #fff;
+ border: solid 1px #C1CDDD;
+ color: #1B3E6F;
+ line-height: 18px;
+ border-radius: 4px;
+}
+.add-attribute .btn:hover{
+ background-color: #1B3E6F;
+}
+.add-attribute .btn:hover i::before{
+ color: #fff;
+}
+.icon-function-attribute{
+ font-size: 18px;
+}
+.add-attribute span{
+ font-size: 11px;
+ line-height: 16px;
+}
+.attributesContainertTitle .btn-group{
+ margin-top: 3px;
+}
+.attributesContainertTitle .btn{
+ margin-left: 8px !important;
+ padding: 1px 9px !important;
+ border-radius: 4px !important;
+}
.attributesContainer h6{
- margin-bottom: 10px;
- padding: 12px 0 12px 15px;
+ padding: 0;
+ margin-bottom: 0;
background: #DEE8F3;
+ line-height: 35px !important;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
color: #1B3E6F;
}
-.actionName{
- margin-bottom: 21px;
+.view-source,
+.view-source:hover{
+ background: #103D73;
+ border-color: #D0DFF1;
+ color: #fff;
+ font-size: 11px;
+}
+.trash-item,
+.trash-item:hover{
+ background: #fff;
+ border-color: #D0DFF1;
+ color: #103D73;
+}
+.trash-item{
+ font-size: 14px;
}
.attributesContainer label{
color: #1B3E6F;
- text-transform: uppercase;
- font-size: 11px;
+ /* text-transform: uppercase; */
+ font-size: 12px;
font-weight: bold;
}
+.attributesContainer label.custom-control-label{
+ text-transform: unset;
+ font-weight: normal;
+}
.attributesContainer .form-group{
margin-bottom: 9px;
}
.attributesContainer .form-control::placeholder{
color: #CFD7E5;
}
-.scrolll{
- max-height: 88.75vh;
- overflow-y: auto;
+.attributesContainer .attribute-value{
+ text-transform: unset;
+ display: block;
+ width: 100%;
+ padding: 0 .75rem .375rem 0;
+ font-size: 12px;
+ font-weight: normal;
+}
+.attributesContainer textarea{
+ height: 60px;
+}
+.icon-required-star{
+ font-size: 10px;
+}
+.optional-attribute::before{
+ color: #CAD3E0;
+}
+.attributeOptions{
+ display: none;
+ border: 0;
+}
+.attributeOptions a:not(:first-child){
+ margin-left: 18px;
+}
+.attributeOptions i{
+ color: #103D73 !important;
+ font-size: 16px;
+}
+.editAttribute i{
+ font-size: 14px;
+}
+.action-attributes .form-group{
+ display: inline-block;
+ width: 100%;
+ padding-left: 12px;
+ /* line-height: 30px; */
+}
+.action-attributes .form-group:hover{
+ cursor: pointer !important;
+ background-color: #F5FAFF;
+}
+.action-attributes .form-group:hover label{
+ cursor: pointer !important;
+ /* padding-left: 12px; */
+}
+.action-attributes .form-group:hover .attributeOptions{
+ display: inline-block;
+ position: relative;
+ left: 8%;
+ top: 3px;
+}
+
+.btn-select-template{
+ background-color: #C3CDDB;
+ border-radius: 2px;
+ color: #1B3E6F;
+ font-size: 12px;
+}
+.btn-select-template i{
+ font-size: 16px;
+ vertical-align: text-bottom;
+}
+.attribute-wrap{
+ padding-bottom: 15px;
+ margin-bottom: 9px;
+ border-bottom: solid 1px #F4F9FE;
+}
+.attribute-wrap .form-group{
+ margin-bottom: 0;
+}
+.template-mapping-list{
+ margin-bottom: 15px;
+ font-size: 13px;
+}
+.template-mapping-list p{
+ width: 56%;
+}
+.deleteTemplate{
+ right: 30px;
+ top: -8px;
+}
+.deleteTemplate i{
+ color: #103D73 !important;
+}
+.icon-close::before{
+ color: #103D73;
+ font-size: 10px !important;
+}
+.accordion{
+ margin-top: 12px;
}
.accordion > .card{
margin-bottom: 0 !important;
border: 0;
+ box-shadow: none;
+}
+.card-header .btn-link,
+.accordion .card-header .btn-link[aria-expanded="true"],
+.accordion .card-header .btn-link[aria-expanded="false"]{
+ padding-left: 15px !important;
+ padding-right: 15px !important;
}
.accordion > .card .card-header{
margin: 0;
- padding: 0;
+ padding: 0 !important;
background-color: #F4F9FE;
border: 0;
border-radius: 0;
}
+
.accordion > .card .card-body{
- padding-bottom: 10px !important;
+ padding-top: 20px !important;
+ padding-bottom: 0 !important;
}
.accordion .btn-link{
padding: 0;
text-transform: uppercase;
line-height: 15px;
}
+.btn-link::before{
+ font-size: 15px !important;
+}
.accordion .btn-link:hover{
color: #103D73;
text-decoration: unset;
font-weight: normal;
font-size: 12px;
}
-.accordion .card-header .btn-link[aria-expanded="true"]:after{
+/* .accordion .card-header .btn-link[aria-expanded="true"]:after{
content: "\f078";
}
.accordion .card-header .btn-link[aria-expanded="false"]:after{
content: "\f054";
-}
+} */
.btn-addAttribute{
width: 20px;
height: 20px;
margin-left: 12px;
font-weight: bold;
}
-.function-attribute{
- margin-right: -16px;
-}
.trash-span{
- margin-left: 150px;
font-size:15px
}
.zoom-percent{
font-size: 12px;
}
+/*Modal*/
+.modal-backdrop{z-index: -1}
+.modal-holder.modal-backdrop{z-index: 100}
+.modal-holder + .modal-dialog {z-index: 1000}
+.modal-dialog{
+ max-width: 680px;
+}
\ No newline at end of file
</li>
<i class="fa fa-angle-right ml-2 mr-2"></i>
<li class="breadcrumb-item">
- <a href="/package/{{viewedPackage.id}}">{{viewedPackage.artifactName}}</a>
+ <a routerLink="/packages/package/{{viewedPackage.id}}">{{viewedPackage.artifactName}}</a>
<button type="button" class="btn package-info-btn" data-toggle="modal"
- data-target="#exampleModalLong">
+ data-target="#exampleModalLong">
<i class="icon-info" aria-hidden="true"></i>
</button>
</li>
</li>
</ol>
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog"
- aria-labelledby="exampleModalLongTitle" aria-hidden="true">
+ aria-labelledby="exampleModalLongTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Package Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <img src="assets/img/icon-close.svg" />
+ <img src="assets/img/icon-close.svg"/>
</button>
</div>
<div class="modal-body package-info">
<li>
<div class="btn-group" role="group" aria-label="Basic example">
<a href="#" role="button" aria-pressed="true" class="btn-topology-action float tooltip-bottom"
- data-tooltip="Preview">
+ data-tooltip="Preview">
<i class="fa fa-eye"></i>
</a>
<a href="#" role="button" aria-pressed="true" class="btn-topology-action float tooltip-bottom"
- data-tooltip="Download">
+ data-tooltip="Download">
<i class="fa fa-download"></i>
</a>
<a href="#" role="button" aria-pressed="true" class="btn-topology-action float tooltip-bottom"
- data-tooltip="Share">
+ data-tooltip="Share">
<i class="fa fa-share-square"></i>
</a>
</div>
<div class="dropdown">
<input class="dropdown-toggle" type="text">
<div class="dropdown-text">Save</div>
- <ul class="dropdown-content">
+ <ul class="dropdown-content save-blueprint">
<li>
- <a href="">Save</a>
+ <a (click)="saveBluePrint()">Save</a>
</li>
<li>
- <a href="">Save & Deploy</a>
+ <a (click)="publishBluePrint()">Save & Deploy</a>
</li>
</ul>
</div>
</div>
</div>
</header>
-
+<!--Editor Bar-->
<nav class="editNavbar row source-button {{cl}} navbar navbar-expand-lg">
+ <!--Actions/Functions Side Menu Toogole Button-->
<button (click)="_toggleSidebar1()" class="toggoleBtn active btn tooltip-bottom" title="" aria-pressed="true"
- data-tooltip="Collapse Side bar">
+ data-tooltip="Collapse Side bar">
<i class="fa arr-size"></i>
</button>
+ <!--Nav Tabs-->
<div class="collapse navbar-collapse ">
+ <!--Action Tabs-->
<ul class="navbar-nav">
<li class="nav-item active">
<nav class="row">
- <!--Nav Tabs-->
<div class="col-12">
<div class="nav nav-tabs " id="nav-tab" role="tablist">
<a class="nav-item nav-link active col-6" id=" " data-toggle="tab" href="" role="tab"
- aria-controls=" " aria-selected="false" autofocus #nameit>Workflow</a>
+ aria-controls=" " aria-selected="false" autofocus #nameit>Workflow</a>
<a class="nav-item nav-link col-6" id=" " data-toggle="tab" href="" role="tab"
- aria-controls=" " aria-selected="false">Template</a>
+ aria-controls=" " aria-selected="false">Template</a>
</div>
</div>
</nav>
</li>
</ul>
+ <!--Requirement/Capability Legend-->
<ul class="templateLegend ml-auto mr-auto p-0">
<li class="requirement"><i class="icon-rectangle" aria-hidden="true"></i> Requirement</li>
<li class="capability"><i class="icon-rectangle" aria-hidden="true"></i> Capability</li>
</ul>
-
+ <!--Undo/Redo Buttons-->
<ul class="editor navbar">
<li>
<button type="button" class="btn tooltip-bottom" data-tooltip="Undo">
</button>
</li>
<li class="vertical_line"></li>
- <li><button type="button" class="btn tooltip-bottom" data-tooltip="Zoom Out">
+ <li>
+ <button type="button" class="btn tooltip-bottom" data-tooltip="Zoom Out">
<img src="/assets/img/icon-zoomOut.svg">
- </button></li>
+ </button>
+ </li>
<li class="zoom-percent">100%</li>
<li>
<button type="button" class="btn tooltip-bottom" data-tooltip="Zoom In">
- <img src="/assets/img/icon-zoomIn.svg"> </button>
+ <img src="/assets/img/icon-zoomIn.svg"></button>
</li>
</ul>
-
+ <!--Designer/Scripting View Tabs-->
<ul class="navbar ml-2" style="list-style: none">
<li class="nav-item">
<div class="btn-group viewBtns" role="group">
<button type="button" class="btn btn-secondary topologySource active">Designer</button>
<button [routerLink]="['/designer/source', viewedPackage.id]" type="button"
- class="btn btn-secondary topologyView">Scripting</button>
+ class="btn btn-secondary topologyView">Scripting
+ </button>
</div>
</li>
</ul>
-
</div>
</nav>
<ng-sidebar-container class="sidebar-container">
- <!-- Controller SideBar -->
+ <!--Left Side Menu-->
<ng-sidebar [(opened)]="controllerSideBar" [sidebarClass]="'demo-sidebar controllerSidebar container-fluid'"
- [mode]="'push'" #sidebarLeft>
-
+ [mode]="'push'" #sidebarLeft>
<nav class="row">
<!--Nav Tabs-->
<div class="col">
<div class="nav nav-tabs " id="nav-tab" role="tablist">
<a class="nav-item nav-link active col-6" id="nav-action-tab" data-toggle="tab" href="#nav-action"
- role="tab" aria-controls="nav-action" aria-selected="false" autofocus #nameit>Actions</a>
+ role="tab" aria-controls="nav-action" aria-selected="false" autofocus #nameit>Actions</a>
<a class="nav-item nav-link col-6" id="nav-function-tab" data-toggle="tab" href="#nav-function"
- role="tab" aria-controls="nav-function" aria-selected="false">Functions</a>
+ role="tab" aria-controls="nav-function" aria-selected="false">Functions</a>
</div>
</div>
</nav>
<div class="col">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-action" role="tabpanel"
- aria-labelledby="nav-action-tab">
+ aria-labelledby="nav-action-tab">
<!--Action Search Box-->
<input type="text" class="form-control input-search-controller" placeholder="Search Actions">
-
+ <button (click)="sidebarRight1.open()" type="button" class="btn btn-primary">
+ Action Attributes
+ </button>
+ <br/><br/>
+ <button (click)="sidebarRight2.open()" type="button" class="btn btn-secondary">
+ Function Attributes
+ </button>
+ <br/>
<button (click)="insertCustomActionIntoBoard()" type="button" class="btn new-action">
+ New Action
</button>
<label><i class="icon-file" aria-hidden="true"></i>
{{customActionName}} </label>
</div>
+ <div *ngIf="!showAction" class="custom-control">
+ <ul>
+ <li *ngFor="let customActionName of actions">
+ <label>
+ <i class="icon-file" aria-hidden="true" class="icon-file"
+ (click)="openFunctionAttributes(customActionName)"></i>
+ {{customActionName}} </label>
+ </li>
+ </ul>
+ </div>
</div>
</div>
<div class="tab-pane fade" id="nav-function" role="tabpanel" aria-labelledby="nav-function-tab">
<!--Function Search Box-->
<input type="text" class="form-control input-search-controller" placeholder="Search Functions">
- <div id="palette-paper" class="componentsList"> </div>
+ <div id="palette-paper" class="componentsList"></div>
</div>
-
</div>
</div>
</div>
- <div class="helpBox"><i class="icon-info" aria-hidden="true"></i><a
- href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank">Help - Learn The Basics</a>
+ <div class="helpBox"><i class="icon-info" aria-hidden="true"></i>
+ <a href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank">Help - Learn The Basics</a>
</div>
</ng-sidebar>
- <!-- Page content -->
-
+ <!--Page content-->
<div ng-sidebar-content id="board-paper">
<button class="rotate" (click)="_toggleSidebar1()">
<span>
</span>
</button>
- <!-- Canvas -->
+
+ <!-- CANVAS -->
+ <!--Editor Bar-->
<div class="editBar text-center">
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-secondary tooltip-bottom" data-tooltip="Undo">
<button type="button" class="btn btn-secondary topologyView">Source</button>
</div>
</div>
- <!-- <div class="card actionContainer">
- <div class="card-header">
- <span>Action 1</span>
- </div>
- <div class="card-body">
- <a (click)="sidebarRight.open()" class="componentContainer text-center">
- <img src="/assets/img/icon-comType1.svg" title="">
- <h2>config-assign</h2>
- <p>component-resource-resolution</p>
- </a>
- <a (click)="sidebarRight.open()" class="componentContainer text-center">
- <img src="/assets/img/icon-comType2.svg" title="">
- <h2>execute</h2>
- <p>component-netconf-executor</p>
- </a>
- <a (click)="sidebarRight.open()" class="componentContainer text-center">
- <img src="/assets/img/icon-comType3.svg" title="">
- <h2>function 1</h2>
- <p>dg-generic</p>
- </a>
- <a (click)="sidebarRight.open()" class="componentContainer text-center">
- <img src="/assets/img/icon-comType2.svg" title="">
- <h2>execute</h2>
- <p>component-netconf-executor</p>
- </a>
- </div>
- </div> -->
- <!-- <button (click)="_toggleSidebar2()" style="float:right;">Toggle sidebar right</button> -->
+ <!--<button (click)="_toggleSidebar2()" style="float:right;">Toggle sidebar right</button> -->
</div>
- <!-- Action Attribute SideBar -->
- <ng-sidebar [(opened)]="attributesSideBar" [sidebarClass]="'demo-sidebar attributesSideBar '" [mode]="'push'"
- [position]="'right'" #sidebarRight>
+ <ng-sidebar [(opened)]="actionAttributesSideBar" [sidebarClass]="'demo-sidebar attributesSideBar '" [mode]="'push'"
+ [position]="'right'" #sidebarRight1>
<div class="container-fluid0">
<div class="row m-0">
- <div class="col-2 pr-0">
- <button (click)="sidebarRight.close()" class="closeBar"></button>
- </div>
- <div class="col-10 attributesContainer p-0">
- <h1>Action Attributes</h1>
- <div class="scrolll">
- <div class="row m-0">
- <div class="col">
- <div class="form-group actionName">
- <label for="exampleInputEmail1">Action Name</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
- </div>
+ <div class="col attributesContainer">
+ <div class="row m-0 attributesContainertTitle">
+ <div class="col-2 pl-0">
+ <button (click)="sidebarRight1.close()" class="closeBar" tooltip="Close" placement="bottom">
+ <i
+ class="icon-close" type="button" aria-hidden="true"></i></button>
</div>
- <div class="accordion" id="accordionExample">
- <div class="card">
- <div class="card-header row" id="headingOne">
- <h2 class="col-10 mb-0">
- <button class="btn btn-link" type="button" data-toggle="collapse"
- data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
- Steps
- </button>
- </h2>
- <div class="col-2 p-0 text-center">
- <button class="btn btn-addAttribute" type="button"></button>
- </div>
- </div>
-
- <div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
- data-parent="#accordionExample">
- <div class="card-body">
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">Name</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Name</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
- <div class="form-group">
- <label for="exampleFormControlTextarea1">Description</label>
- <textarea class="form-control" id="exampleFormControlTextarea1"
- rows="3"></textarea>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Target</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
-
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header row" id="headingTwo">
- <h2 class="col-10 mb-0">
- <button class="btn btn-link" type="button" data-toggle="collapse"
- data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
- Inputs
- </button>
- </h2>
- <div class="col-2 p-0 text-center">
- <button class="btn btn-addAttribute" type="button"></button>
- </div>
- </div>
- <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo"
- data-parent="#accordionExample">
- <div class="card-body">
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">Name</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Name</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
- <div class="form-group">
- <label for="exampleFormControlTextarea1">Description</label>
- <textarea class="form-control" id="exampleFormControlTextarea1"
- rows="3"></textarea>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Target</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
-
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header row" id="headingThree">
- <h2 class="col-10 mb-0">
- <button class="btn btn-link" type="button" data-toggle="collapse"
- data-target="#collapseThree" aria-expanded="true"
- aria-controls="collapseThree">
- Outputs
- </button>
- </h2>
- <div class="col-2 p-0 text-center">
- <button class="btn btn-addAttribute" type="button"></button>
- </div>
- </div>
- <div id="collapseThree" class="collapse show" aria-labelledby="headingThree"
- data-parent="#accordionExample">
- <div class="card-body">
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">Name</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Name</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
- <div class="form-group">
- <label for="exampleFormControlTextarea1">Description</label>
- <textarea class="form-control" id="exampleFormControlTextarea1"
- rows="3"></textarea>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Target</label>
- <input type="text" class="form-control" placeholder="Action 1">
- </div>
-
- </div>
- </div>
+ <h6 class="col pl-0">Action Attributes</h6>
+ <div class="col-3 pl-0">
+ <div class="btn-group" role="group" aria-label="Basic example">
+ <button type="button" class="btn view-source" tooltip="View Action Source"
+ placement="bottom"><i class="icon-source"></i></button>
+ <button type="button" data-toggle="modal" data-target="#exampleModalScrollable1"
+ class="btn trash-item" tooltip="Delete Action" placement="bottom"><i
+ class="icon-delete-sm" aria-hidden="true"></i></button>
</div>
</div>
</div>
+ <app-action-attributes></app-action-attributes>
</div>
</div>
</div>
</ng-sidebar>
-
- <!-- Function Attribute SideBar -->
- <ng-sidebar [(opened)]="functionAttributeSidebar" [sidebarClass]="'demo-sidebar functionAttributeSidebar '"
- [mode]="'push'" [position]="'right'" #sidebarRight>
+ <!--Right Side Menu - Function Attribute-->
+ <ng-sidebar [(opened)]="functionAttributeSidebar" [sidebarClass]="'demo-sidebar attributesSideBar'" [mode]="'push'"
+ [position]="'right'" #sidebarRight2>
<div class="container-fluid0">
<div class="row m-0">
- <div class="col-2 pr-0">
- <!-- <button (click)="sidebarRight.close()" class="closeBar"></button> -->
- </div>
- <div class="col-10 attributesContainer p-0">
- <div class="row m-0">
- <div class="col">
- <div class="col-3">
- <button (click)="sidebarRight.close()" class="closeBar"></button>
- </div>
-
- <div class="function-attribute">
- <h6>Function Attributes
- <span class="trash-span">
- <i class="fa fa-trash" type="button" aria-hidden="true"></i>
- </span>
- </h6>
- </div>
-
-
- </div>
- </div>
-
- <div>
- <div class="row m-0">
- <div class="col">
- <div class="form-group actionName">
- <label for="exampleInputEmail1">Function Name</label>
- <input type="text" class="form-control" placeholder="Function Name">
- </div>
- </div>
- </div>
- <div class="row m-0">
- <div class="col">
- <div class=" actionName">
- <label>Function Type</label>
- <div class="dropdown w-100">
- <input class="dropdown-toggle" type="text">
- <div class="dropdown-text">component-resource-resolution <i
- class="fa fa-caret-down"></i></div>
- <ul class="dropdown-content w-100">
- <li>
- <div class="form-group ">
- <li>other component</li>
- </div>
- </li>
- </ul>
- </div>
- </div>
+ <div class="col attributesContainer">
+ <div class="row m-0 attributesContainertTitle">
+ <div class="col-2 pl-0">
+ <button (click)="sidebarRight2.close()" class="closeBar" tooltip="Close"
+ placement="bottom"><i class="icon-close" type="button" aria-hidden="true"></i>
+ </button>
</div>
- </div>
- <div class="accordion" id="accordionExample">
- <div class="card">
- <div class="card-header row" id="headingOne">
- <h2 class="col-10 mb-0">
- <button class="btn btn-link" type="button" data-toggle="collapse"
- data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
- Interface
- </button>
- </h2>
- <div class="col-2 p-0 text-center">
- <button class="btn btn-addAttribute" type="button"></button>
- </div>
- </div>
-
- <div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
- data-parent="#accordionExample">
- <div class="card-body">
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">ResourceResolutionComponent</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Resoluton-key</label>
- <input type="text" class="form-control">
- </div>
- <div class="form-group">
- <label for="exampleFormControlTextarea1">Store result</label>
- </div>
- <div class="form-group">
- <label>
- <input class="with-gap radio-btn" name="group1" type="radio" />
- <span class="radio-btn">True</span>
- </label>
- <label class="radio-btn">
- <input class="with-gap radio-btn" name="group1" type="radio" />
- <span class="radio-btn">False</span>
- </label>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Target</label>
- <input type="text" class="form-control" placeholder="">
- </div>
- <div class="form-group">
- <label for="exampleFormControlTextarea1">Artifact Prefix Name</label>
- <input type="text" class="form-control" placeholder="">
-
- </div>
-
- </div>
- </div>
- </div>
-
- </div>
-
- <div class="accordion" id="accordionExample">
- <div class="card">
- <div class="card-header row" id="headingOne">
- <h2 class="col-10 mb-0">
- <button class="btn btn-link" type="button" data-toggle="collapse"
- data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
- Artifact
- </button>
- </h2>
- <div class="col-2 p-0 text-center">
- <button class="btn btn-addAttribute" type="button"></button>
- </div>
- </div>
-
- <div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
- data-parent="#accordionExample">
- <div class="card-body">
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">base config-template</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Type</label>
- <div class="dropdown w-100">
- <input class="dropdown-toggle" type="text">
- <div class="dropdown-text">artifact-template-velocity <i
- class="fa fa-caret-down"></i></div>
- <ul class="dropdown-content w-100">
- <li>
- <div class="form-group ">
- <li>ddwd</li>
- </div>
- </li>
- </ul>
- </div>
- </div>
-
- <div style="height: 30px; margin-top: 30px;">
- <hr>
- </div>
-
- <div class="row">
- <div class="col-9">
- <label for="exampleInputEmail1">base config-mapping</label>
- <button type="button" class="btn p-0">
- <img src="/assets/img/icon-edit.svg">
- </button>
- </div>
- <div class="col-3">
- <button type="button" class="btn btn-deleteAttribute">Delete</button>
- </div>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">Type</label>
- <div class="dropdown w-100">
- <input class="dropdown-toggle" type="text">
- <div class="dropdown-text">artifact-mapping resource <i
- class="fa fa-caret-down"></i></div>
- <ul class="dropdown-content w-100">
- <li>
- <div class="form-group ">
- <li>ddwd</li>
- </div>
- </li>
- </ul>
- </div>
- </div>
-
- <div style="height: 30px; margin-top: 30px;">
- <hr>
+ <h6 class="col pl-0">Function Attributes</h6>
+ <div class="col-3 pl-0">
+ <div class="btn-group" role="group" aria-label="Basic example">
+ <button type="button" class="btn view-source" tooltip="View Function Source"
+ placement="bottom"><i class="icon-source"></i></button>
+ <button type="button" class="btn trash-item" tooltip="Delete Function"
+ placement="bottom"><i class="icon-delete-sm" type="button"
+ aria-hidden="true"></i></button>
</div>
</div>
</div>
+ <app-functions-attribute></app-functions-attribute>
</div>
-
</div>
</div>
- </div>
- </div>
- </div>
</ng-sidebar>
-</ng-sidebar-container>
\ No newline at end of file
+
+</ng-sidebar-container>
+
===================================================================
Modification Copyright (c) 2020 IBM
===================================================================
+Modification Copyright (c) 2020 Orange
+===================================================================
Unless otherwise specified, all software contained herein is licensed
under the Apache License, Version 2.0 (the License);
import dagre from 'dagre';
import graphlib from 'graphlib';
-import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
+import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
import * as joint from 'jointjs';
import './jointjs/elements/palette.function.element';
import './jointjs/elements/action.element';
import './jointjs/elements/board.function.element';
-import { DesignerStore } from './designer.store';
-import { ActionElementTypeName } from 'src/app/common/constants/app-constants';
-import { GraphUtil } from './graph.util';
-import { GraphGenerator } from './graph.generator.util';
-import { FunctionsStore } from './functions.store';
-import { Subject, empty } from 'rxjs';
-import { takeUntil } from 'rxjs/operators';
-import { distinctUntilChanged } from 'rxjs/operators';
-import { BluePrintDetailModel } from '../model/BluePrint.detail.model';
-import { ActivatedRoute } from '@angular/router';
-import { DesignerService } from './designer.service';
-import { isDefined } from '@angular/compiler/src/util';
+import {DesignerStore} from './designer.store';
+import {ActionElementTypeName} from 'src/app/common/constants/app-constants';
+import {GraphUtil} from './graph.util';
+import {GraphGenerator} from './graph.generator.util';
+import {FunctionsStore} from './functions.store';
+import {Subject} from 'rxjs';
+import {distinctUntilChanged, takeUntil} from 'rxjs/operators';
+import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
+import {ActivatedRoute, Router} from '@angular/router';
+import {DesignerService} from './designer.service';
+import {FilesContent, FolderNodeElement} from '../package-creation/mapping-models/metadata/MetaDataTab.model';
+import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes';
+import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder';
+import {PackageCreationStore} from '../package-creation/package-creation.store';
+import {PackageCreationService} from '../package-creation/package-creation.service';
+import {PackageCreationUtils} from '../package-creation/package-creation.utils';
+import * as JSZip from 'jszip';
+import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service';
+import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model';
+import {TopologyTemplate} from './model/designer.topologyTemplate.model';
+import {ToastrService} from 'ngx-toastr';
@Component({
- selector: 'app-designer',
- templateUrl: './designer.component.html',
- styleUrls: ['./designer.component.css'],
- encapsulation: ViewEncapsulation.None
+ selector: 'app-designer',
+ templateUrl: './designer.component.html',
+ styleUrls: ['./designer.component.css'],
+ encapsulation: ViewEncapsulation.None
})
export class DesignerComponent implements OnInit, OnDestroy {
- controllerSideBar: boolean;
- attributesSideBar: boolean;
- functionAttributeSidebar: boolean;
- viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
- customActionName: string;
- showAction: boolean;
- cl = 'editBar';
-
- boardGraph: joint.dia.Graph;
- boardPaper: joint.dia.Paper;
-
- paletteGraph: joint.dia.Graph;
- palettePaper: joint.dia.Paper;
- ngUnsubscribe = new Subject();
- opt = { tx: 100, ty: 100 };
-
- constructor(
- private designerStore: DesignerStore,
- private functionStore: FunctionsStore,
- private graphUtil: GraphUtil,
- private graphGenerator: GraphGenerator,
- private route: ActivatedRoute,
- private designerService: DesignerService) {
- this.controllerSideBar = true;
- this.attributesSideBar = false;
- this.showAction = false;
- this.functionAttributeSidebar = false;
-
- }
- _toggleSidebar1() {
- this.controllerSideBar = !this.controllerSideBar;
- if (this.controllerSideBar === false) {
- this.cl = 'editBar2';
+ controllerSideBar: boolean;
+ actionAttributesSideBar: boolean;
+ functionAttributeSidebar: boolean;
+ viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
+ customActionName: string;
+ showAction: boolean;
+ cl = 'editBar';
+
+ boardGraph: joint.dia.Graph;
+ boardPaper: joint.dia.Paper;
+
+ paletteGraph: joint.dia.Graph;
+ palettePaper: joint.dia.Paper;
+ ngUnsubscribe = new Subject();
+ opt = {tx: 100, ty: 100};
+ filesData: any = [];
+ folder: FolderNodeElement = new FolderNodeElement();
+ zipFile: JSZip = new JSZip();
+ cbaPackage: CBAPackage;
+ actions: string[] = [];
+ dataTarget: string;
+
+ constructor(
+ private designerStore: DesignerStore,
+ private functionStore: FunctionsStore,
+ private packageCreationStore: PackageCreationStore,
+ private packageCreationUtils: PackageCreationUtils,
+ private graphUtil: GraphUtil,
+ private graphGenerator: GraphGenerator,
+ private route: ActivatedRoute,
+ private router: Router,
+ private designerService: DesignerService,
+ private packageCreationService: PackageCreationService,
+ private packageCreationExtractionService: PackageCreationExtractionService,
+ private toastService: ToastrService) {
+ this.controllerSideBar = true;
+ this.actionAttributesSideBar = false;
+ this.showAction = false;
+ this.functionAttributeSidebar = false;
+
+ }
+
+ _toggleSidebar1() {
+ this.controllerSideBar = !this.controllerSideBar;
+ if (this.controllerSideBar === false) {
+ this.cl = 'editBar2';
+ }
+ if (this.controllerSideBar === true) {
+ this.cl = 'editBar';
+ }
}
- if (this.controllerSideBar === true) {
- this.cl = 'editBar';
+
+ _toggleSidebar2() {
+ this.actionAttributesSideBar = !this.actionAttributesSideBar;
}
- }
- _toggleSidebar2() {
- this.attributesSideBar = !this.attributesSideBar;
- }
- // private _toggleSidebar3() {
- // this.functionAttributeSidebar = !this.functionAttributeSidebar;
- // }
-
-
- /**
- * - There is a board (main paper) that will the action and function selected from the palette
- * itmes in this board will be used to create tosca workflow and node templates
- * - There is also palette , whis contains all the possible functions and actions
- * that can be dragged into the board
- * - There is also a fly paper , which is temporarliy paper created on the fly
- * when items is dragged from the palette- and it's deleted when the item is dropped over
- * the board.
- * for more info about the drag and drop algorithem used please visit the following link:
- * https://stackoverflow.com/a/36932973/1340034
- */
-
- ngOnInit() {
- this.customActionName = this.route.snapshot.paramMap.get('actionName');
- if (this.customActionName !== '') {
- this.showAction = true;
+
+ publishBluePrint() {
+ this.create();
+ this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ const formData = new FormData();
+ formData.append('file', blob);
+ this.designerService.publishBlueprint(formData).subscribe(res => {
+ console.log('Package Deployed...');
+ }, error => {
+ console.log(error);
+ }, () => {
+ // this.deployBluePrint = false;
+ });
+ });
}
- this.initializeBoard();
- this.initializePalette();
- this.stencilPaperEventListeners();
- const id = this.route.snapshot.paramMap.get('id');
- this.designerService.getPagedPackages(id).subscribe(
- (bluePrintDetailModels) => {
- if (bluePrintDetailModels) {
- this.viewedPackage = bluePrintDetailModels[0];
- }
- });
+
+ // private _toggleSidebar3() {
+ // this.functionAttributeSidebar = !this.functionAttributeSidebar;
+ // }
+
+
/**
- * the code to retrieve from server is commented
+ * - There is a board (main paper) that will the action and function selected from the palette
+ * itmes in this board will be used to create tosca workflow and node templates
+ * - There is also palette , whis contains all the possible functions and actions
+ * that can be dragged into the board
+ * - There is also a fly paper , which is temporarliy paper created on the fly
+ * when items is dragged from the palette- and it's deleted when the item is dropped over
+ * the board.
+ * for more info about the drag and drop algorithem used please visit the following link:
+ * https://stackoverflow.com/a/36932973/1340034
*/
- this.functionStore.state$
- .pipe(
- distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
- takeUntil(this.ngUnsubscribe))
- .subscribe(state => {
-
- if (state.serverFunctions) {
- console.log('inside subscriotn on functions store -->', state.serverFunctions);
- console.log(state);
- // this.viewedFunctions = state.functions;
- const list = state.serverFunctions;
-
- const cells = this.graphUtil.buildPaletteGraphFromList(list);
- this.paletteGraph.resetCells(cells);
-
- let idx = 0;
- cells.forEach(cell => {
- cell.translate(5, (cell.attributes.size.height + 5) * idx++);
- });
- }
- });
-
- this.designerStore.state$
- .pipe(
- distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
- takeUntil(this.ngUnsubscribe))
- .subscribe(state => {
- if (state.sourceContent) {
- console.log('inside desinger.component---> ', state);
- // generate graph from store objects if exist
- const topologtTemplate = JSON.parse(state.sourceContent);
- console.log(topologtTemplate);
- delete state.sourceContent;
- this.graphGenerator.populate(topologtTemplate, this.boardGraph);
-
- console.log('all cells', this.boardGraph.getCells());
- /**
- * auto arrange elements in graph
- * https://resources.jointjs.com/docs/jointjs/v3.1/joint.html#layout.DirectedGraph
- */
- joint.layout.DirectedGraph.layout(this.boardGraph.getCells(), {
- dagre,
- graphlib,
- setLinkVertices: false,
- marginX: 10,
- marginY: 10,
- clusterPadding: { top: 100, left: 30, right: 10, bottom: 100 },
- rankDir: 'TB'
- });
- }
- });
-
- // action triggering
- this.functionStore.retrieveFuntions();
-
- }
-
- initializePalette() {
- if (!this.paletteGraph) {
- this.paletteGraph = new joint.dia.Graph();
- this.palettePaper = new joint.dia.Paper({
- el: $('#palette-paper'),
- model: this.paletteGraph,
- width: 318,
- height: $('#palette-paper').height(),
- // background: {
- // color: 'rgba(0, 255, 0, 0.3)'
- // },
- interactive: false
- // elements in paletter need to be fixed, please refer to flying paper concept
- });
- }
- }
-
- initializeBoard() {
- if (!this.boardGraph) {
- console.log('initializeBoard...');
- this.boardGraph = new joint.dia.Graph();
- this.boardPaper = new joint.dia.Paper({
- el: $('#board-paper'),
- model: this.boardGraph,
- // height: 720,
- // width: 1100,
- gridSize: 10,
- drawGrid: true,
- // background: {
- // color: 'rgba(0, 255, 0, 0.3)'
- // },
- cellViewNamespace: joint.shapes
- });
-
- this.boardPaper.on('all', element => {
- // console.log(element);
- });
-
- this.boardPaper.on('link:pointerdown', link => {
- console.log(link);
- });
-
- this.boardPaper.on('element:pointerdown', element => {
- // this.modelSelected.emit(element.model.get('model'));
- });
-
- this.boardPaper.on('blank:pointerclick', () => {
- // this.selectedModel = undefined;
- });
-
- this.boardGraph.on('change:position', (cell) => {
-
- const parentId = cell.get('parent');
- if (!parentId) {
- // this is action
- return;
+
+ ngOnInit() {
+ this.customActionName = this.route.snapshot.paramMap.get('actionName');
+ if (this.customActionName !== '') {
+ this.showAction = true;
}
+ this.initializeBoard();
+ this.initializePalette();
+ this.stencilPaperEventListeners();
+ const id = this.route.snapshot.paramMap.get('id');
+ this.designerService.getPagedPackages(id).subscribe(
+ (bluePrintDetailModels) => {
+ if (bluePrintDetailModels) {
+ this.viewedPackage = bluePrintDetailModels[0];
+ this.packageCreationService.downloadPackage(this.viewedPackage.artifactName + '/'
+ + this.viewedPackage.artifactVersion)
+ .subscribe(response => {
+ const blob = new Blob([response], {type: 'application/octet-stream'});
+ this.packageCreationExtractionService.extractBlobToStore(blob);
+ });
+ }
+ });
+ this.packageCreationStore.state$.subscribe(cba => {
+ this.cbaPackage = cba;
+ console.log(cba.templateTopology.content);
+ this.designerStore.saveSourceContent(cba.templateTopology.content);
- const parent = this.boardGraph.getCell(parentId);
+ });
- const parentBbox = parent.getBBox();
- const cellBbox = cell.getBBox();
- if (parentBbox.containsPoint(cellBbox.origin()) &&
- parentBbox.containsPoint(cellBbox.topRight()) &&
- parentBbox.containsPoint(cellBbox.corner()) &&
- parentBbox.containsPoint(cellBbox.bottomLeft())) {
+ /**
+ * the code to retrieve from server is commented
+ */
+ this.functionStore.state$
+ .pipe(
+ distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(state => {
+
+ if (state.serverFunctions) {
+ console.log('inside subscriotn on functions store -->', state.serverFunctions);
+ console.log(state);
+ // this.viewedFunctions = state.functions;
+ const list = state.serverFunctions;
+
+ const cells = this.graphUtil.buildPaletteGraphFromList(list);
+ this.paletteGraph.resetCells(cells);
+
+ let idx = 0;
+ cells.forEach(cell => {
+ cell.translate(5, (cell.attributes.size.height + 5) * idx++);
+ });
+ }
+ });
+
+ this.designerStore.state$
+ .pipe(
+ distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(state => {
+ if (state.sourceContent) {
+ console.log('inside desinger.component---> ', state);
+ // generate graph from store objects if exist
+ const topologtTemplate: TopologyTemplate = JSON.parse(state.sourceContent);
+ console.log(topologtTemplate);
+ delete state.sourceContent;
+ this.graphGenerator.clear(this.boardGraph);
+ this.graphGenerator.populate(topologtTemplate, this.boardGraph);
+
+ console.log('all cells', this.boardGraph.getCells());
+ /**
+ * auto arrange elements in graph
+ * https://resources.jointjs.com/docs/jointjs/v3.1/joint.html#layout.DirectedGraph
+ */
+ joint.layout.DirectedGraph.layout(this.boardGraph.getCells(), {
+ dagre,
+ graphlib,
+ setLinkVertices: false,
+ marginX: 10,
+ marginY: 10,
+ clusterPadding: {top: 100, left: 30, right: 10, bottom: 100},
+ rankDir: 'TB'
+ });
+ this.actions = [];
+ for (const workflowsKey in topologtTemplate.workflows) {
+ if (workflowsKey && !this.actions.includes(workflowsKey)) {
+ this.actions.push(workflowsKey);
+ }
+ }
+ }
+ });
+
+ // action triggering
+ this.functionStore.retrieveFuntions();
- // All the four corners of the child are inside
- // the parent area.
- return;
+ }
+
+ initializePalette() {
+ if (!this.paletteGraph) {
+ this.paletteGraph = new joint.dia.Graph();
+ this.palettePaper = new joint.dia.Paper({
+ el: $('#palette-paper'),
+ model: this.paletteGraph,
+ width: 318,
+ height: $('#palette-paper').height(),
+ // background: {
+ // color: 'rgba(0, 255, 0, 0.3)'
+ // },
+ interactive: false
+ // elements in paletter need to be fixed, please refer to flying paper concept
+ });
}
+ }
- // Revert the child position.
- cell.set('position', cell.previous('position'));
- });
+ initializeBoard() {
+ if (!this.boardGraph) {
+ console.log('initializeBoard...');
+ this.boardGraph = new joint.dia.Graph();
+ this.boardPaper = new joint.dia.Paper({
+ el: $('#board-paper'),
+ model: this.boardGraph,
+ // height: 720,
+ // width: 1100,
+ gridSize: 10,
+ drawGrid: true,
+ // background: {
+ // color: 'rgba(0, 255, 0, 0.3)'
+ // },
+ cellViewNamespace: joint.shapes
+ });
+
+ this.boardPaper.on('all', element => {
+ // console.log(element);
+ });
+
+ this.boardPaper.on('link:pointerdown', link => {
+ console.log(link);
+ });
+
+ this.boardPaper.on('element:pointerdown', element => {
+ // this.modelSelected.emit(element.model.get('model'));
+ });
+
+ this.boardPaper.on('blank:pointerclick', () => {
+ // this.selectedModel = undefined;
+ });
+
+ this.boardGraph.on('change:position', (cell) => {
+
+ const parentId = cell.get('parent');
+ if (!parentId) {
+ // this is action
+ return;
+ }
+
+ const parent = this.boardGraph.getCell(parentId);
+
+ const parentBbox = parent.getBBox();
+ const cellBbox = cell.getBBox();
+ if (parentBbox.containsPoint(cellBbox.origin()) &&
+ parentBbox.containsPoint(cellBbox.topRight()) &&
+ parentBbox.containsPoint(cellBbox.corner()) &&
+ parentBbox.containsPoint(cellBbox.bottomLeft())) {
+
+ // All the four corners of the child are inside
+ // the parent area.
+ return;
+ }
+
+ // Revert the child position.
+ cell.set('position', cell.previous('position'));
+ });
+ }
+ console.log('done initializing Board...');
}
- console.log('done initializing Board...');
- }
- insertCustomActionIntoBoard() {
- console.log('saving action to store action workflow....');
- const actionName = this.graphUtil.generateNewActionName();
- this.graphUtil.createCustomActionWithName(actionName, this.boardGraph);
- this.designerStore.addDeclarativeWorkFlow(actionName);
- }
+ insertCustomActionIntoBoard() {
+ console.log('saving action to store action workflow....');
+ const actionName = this.graphUtil.generateNewActionName();
+ this.graphUtil.createCustomActionWithName(actionName, this.boardGraph);
+ this.designerStore.addDeclarativeWorkFlow(actionName);
+ }
- stencilPaperEventListeners() {
- this.palettePaper.on('cell:pointerdown', (draggedCell, pointerDownEvent, x, y) => {
+ stencilPaperEventListeners() {
+ this.palettePaper.on('cell:pointerdown', (draggedCell, pointerDownEvent, x, y) => {
- $('body').append(`
+ $('body').append(`
<div id="flyPaper"
style="position:fixed;z-index:100;opacity:.7;pointer-event:none;background-color: transparent !important;"></div>`
- );
- const flyGraph = new joint.dia.Graph();
- const flyPaper = new joint.dia.Paper({
- el: $('#flyPaper'),
- model: flyGraph,
- interactive: true
- });
- const flyShape = draggedCell.model.clone();
- const pos = draggedCell.model.position();
- const offset = {
- x: x - pos.x,
- y: y - pos.y
- };
-
- flyShape.position(0, 0);
- flyGraph.addCell(flyShape);
- $('#flyPaper').offset({
- left: pointerDownEvent.pageX - offset.x,
- top: pointerDownEvent.pageY - offset.y
- });
- $('body').on('mousemove.fly', mouseMoveEvent => {
- $('#flyPaper').offset({
- left: mouseMoveEvent.pageX - offset.x,
- top: mouseMoveEvent.pageY - offset.y
+ );
+ const flyGraph = new joint.dia.Graph();
+ const flyPaper = new joint.dia.Paper({
+ el: $('#flyPaper'),
+ model: flyGraph,
+ interactive: true
+ });
+ const flyShape = draggedCell.model.clone();
+ const pos = draggedCell.model.position();
+ const offset = {
+ x: x - pos.x,
+ y: y - pos.y
+ };
+
+ flyShape.position(0, 0);
+ flyGraph.addCell(flyShape);
+ $('#flyPaper').offset({
+ left: pointerDownEvent.pageX - offset.x,
+ top: pointerDownEvent.pageY - offset.y
+ });
+ $('body').on('mousemove.fly', mouseMoveEvent => {
+ $('#flyPaper').offset({
+ left: mouseMoveEvent.pageX - offset.x,
+ top: mouseMoveEvent.pageY - offset.y
+ });
+ });
+
+ $('body').on('mouseup.fly', mouseupEvent => {
+ const mouseupX = mouseupEvent.pageX;
+ const mouseupY = mouseupEvent.pageY;
+ const target = this.boardPaper.$el.offset();
+ // Dropped over paper ?
+ if (mouseupX > target.left &&
+ mouseupX < target.left + this.boardPaper.$el.width() &&
+ mouseupY > target.top && y < target.top + this.boardPaper.$el.height()) {
+ const functionType = this.graphUtil.getFunctionTypeFromPaletteFunction(flyShape);
+ // step name is CDS realted terminology, please refer to tosca types
+ const stepName = functionType;
+ const functionElementForBoard = this.graphUtil.dropFunctionOverActionWithPosition(
+ stepName, functionType,
+ mouseupX, mouseupY,
+ target, offset,
+ this.boardGraph);
+
+ const parentCell = this.graphUtil.getParent(functionElementForBoard, this.boardPaper);
+
+ if (parentCell &&
+ parentCell.model.attributes.type === ActionElementTypeName &&
+ this.graphUtil.canEmpedMoreChildern(parentCell.model, this.boardGraph)) {
+
+ if (this.graphUtil.isEmptyParent(parentCell.model)) {
+ // first function in action
+ const actionName = parentCell.model.attributes.attrs['#label'].text;
+ this.designerStore.addStepToDeclarativeWorkFlow(actionName, stepName, functionType);
+ if (functionType === 'dg-generic') {
+ this.designerStore.addDgGenericNodeTemplate(stepName);
+ } else {
+ this.designerStore.addNodeTemplate(stepName, functionType);
+ }
+ } else {
+ // second action means there was a dg-generic node before
+ this.designerStore.addNodeTemplate(stepName, functionType);
+ // this will fail if multiple dg-generic were added
+ // TODO prevent multi functions of the same type inside the same action
+ const dgGenericNode = this.graphUtil.getDgGenericChild(parentCell.model, this.boardGraph)[0];
+ const dgGenericNodeName = this.graphUtil.getFunctionNameFromBoardFunction(dgGenericNode);
+ this.designerStore.addDgGenericDependency(dgGenericNodeName, stepName);
+ }
+
+
+ // Prevent recursive embedding.
+ if (parentCell &&
+ parentCell.model.get('parent') !== functionElementForBoard.id) {
+ parentCell.model.embed(functionElementForBoard);
+ }
+ } else {
+ console.log('function dropped outside action or not allowed, rolling back...');
+ alert('function dropped outside action or not allowed, rolling back...');
+ functionElementForBoard.remove();
+ }
+ }
+ $('body').off('mousemove.fly').off('mouseup.fly');
+ // flyShape.remove();
+ $('#flyPaper').remove();
+ });
});
- });
-
- $('body').on('mouseup.fly', mouseupEvent => {
- const mouseupX = mouseupEvent.pageX;
- const mouseupY = mouseupEvent.pageY;
- const target = this.boardPaper.$el.offset();
- // Dropped over paper ?
- if (mouseupX > target.left &&
- mouseupX < target.left + this.boardPaper.$el.width() &&
- mouseupY > target.top && y < target.top + this.boardPaper.$el.height()) {
- const functionType = this.graphUtil.getFunctionTypeFromPaletteFunction(flyShape);
- // step name is CDS realted terminology, please refer to tosca types
- const stepName = functionType;
- const functionElementForBoard = this.graphUtil.dropFunctionOverActionWithPosition(
- stepName, functionType,
- mouseupX, mouseupY,
- target, offset,
- this.boardGraph);
-
- const parentCell = this.graphUtil.getParent(functionElementForBoard, this.boardPaper);
-
- if (parentCell &&
- parentCell.model.attributes.type === ActionElementTypeName &&
- this.graphUtil.canEmpedMoreChildern(parentCell.model, this.boardGraph)) {
-
- if (this.graphUtil.isEmptyParent(parentCell.model)) {
- // first function in action
- const actionName = parentCell.model.attributes.attrs['#label'].text;
- this.designerStore.addStepToDeclarativeWorkFlow(actionName, stepName, functionType);
- if (functionType === 'dg-generic') {
- this.designerStore.addDgGenericNodeTemplate(stepName);
- } else {
- this.designerStore.addNodeTemplate(stepName, functionType);
- }
- } else {
- // second action means there was a dg-generic node before
- this.designerStore.addNodeTemplate(stepName, functionType);
- // this will fail if multiple dg-generic were added
- // TODO prevent multi functions of the same type inside the same action
- const dgGenericNode = this.graphUtil.getDgGenericChild(parentCell.model, this.boardGraph)[0];
- const dgGenericNodeName = this.graphUtil.getFunctionNameFromBoardFunction(dgGenericNode);
- this.designerStore.addDgGenericDependency(dgGenericNodeName, stepName);
- }
-
-
- // Prevent recursive embedding.
- if (parentCell &&
- parentCell.model.get('parent') !== functionElementForBoard.id) {
- parentCell.model.embed(functionElementForBoard);
- }
- } else {
- console.log('function dropped outside action or not allowed, rolling back...');
- alert('function dropped outside action or not allowed, rolling back...');
- functionElementForBoard.remove();
- }
- }
- $('body').off('mousemove.fly').off('mouseup.fly');
- // flyShape.remove();
- $('#flyPaper').remove();
- });
- });
- console.log('done stencilPaperEventListeners()...');
- }
-
- ngOnDestroy() {
- this.ngUnsubscribe.next();
- this.ngUnsubscribe.complete();
- }
+ console.log('done stencilPaperEventListeners()...');
+ }
+
+ ngOnDestroy() {
+ this.ngUnsubscribe.next();
+ this.ngUnsubscribe.complete();
+ }
+
+ saveBluePrint() {
+
+ FilesContent.clear();
+ let packageCreationModes: PackageCreationModes;
+ this.cbaPackage = PackageCreationModes.mapModeType(this.cbaPackage);
+ this.cbaPackage.metaData = PackageCreationModes.setEntryPoint(this.cbaPackage.metaData);
+ packageCreationModes = PackageCreationBuilder.getCreationMode(this.cbaPackage);
+ this.designerStore.state$.subscribe(state => {
+ this.cbaPackage.templateTopology.content = this.packageCreationUtils.transformToJson(state.template);
+ });
+ packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils);
+ this.filesData.push(this.folder.TREE_DATA);
+ this.saveBluePrintToDataBase();
+
+ }
+
+ create() {
+ this.zipFile = new JSZip();
+ FilesContent.getMapOfFilesNamesAndContent().forEach((value, key) => {
+ this.zipFile.folder(key.split('/')[0]);
+ this.zipFile.file(key, value);
+ });
+
+ }
+
+ saveBluePrintToDataBase() {
+ this.create();
+ this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ this.packageCreationService.savePackage(blob).subscribe(
+ bluePrintDetailModels => {
+ this.toastService.info('success updating the package');
+ const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
+ this.router.navigate(['/packages/designer/' + id]);
+ console.log('success');
+ }, error => {
+ this.toastService.error('error happened when editing ' + error.message);
+ console.log('Error -' + error.message);
+ });
+ });
+ }
+
+ openFunctionAttributes(customActionName: string) {
+ console.log('opening here function attributes');
+ }
}
============LICENSE_END============================================
*/
-import {Injectable} from '@angular/core';
-import {Observable} from 'rxjs';
-import {ApiService} from '../../../../common/core/services/api.typed.service';
-import {ResourceDictionaryURLs, BlueprintURLs} from '../../../../common/constants/app-constants';
-import {ModelType} from './model/ModelType.model';
+import { Injectable } from '@angular/core';
+import { Observable } from 'rxjs';
+import { ApiService } from '../../../../common/core/services/api.typed.service';
+import { ResourceDictionaryURLs, BlueprintURLs } from '../../../../common/constants/app-constants';
+import { ModelType } from './model/ModelType.model';
import { BluePrintDetailModel } from '../model/BluePrint.detail.model';
})
export class DesignerService {
- constructor(private api: ApiService<ModelType>,
- private api2: ApiService<BluePrintDetailModel>) {
+ constructor(
+ private api: ApiService<ModelType>,
+ private api2: ApiService<BluePrintDetailModel>
+ ) {
}
getFunctions(modelDefinitionType: string): Observable<ModelType[]> {
return this.getBluePrintModel(id);
}
+ publishBlueprint(body: any | null, options?: any): Observable<any> {
+
+ return this.api.post(BlueprintURLs.publish, body, { responseType: 'text' });
+ }
+
}
import {Store} from '../../../../common/core/stores/Store';
import {DesignerService} from './designer.service';
import {DesignerDashboardState} from './model/designer.dashboard.state';
-import { DeclarativeWorkflow } from './model/designer.workflow';
-import { NodeTemplate } from './model/desinger.nodeTemplate.model';
+import {DeclarativeWorkflow} from './model/designer.workflow';
+import {NodeTemplate} from './model/desinger.nodeTemplate.model';
@Injectable({
});
}
- addStepToDeclarativeWorkFlow(workflowName: string, stepName: string, stepType: string) {
+ addStepToDeclarativeWorkFlow(workflowName: string, stepName: string, stepType: string) {
this.setState({
...this.state,
template: {
}
saveSourceContent(code: string) {
- const topologyTemplate = JSON.parse(code);
- this.setState({
- ...this.state,
- sourceContent: code,
- template: topologyTemplate
- });
+ console.log(code);
+ if (code) {
+ const topologyTemplate = JSON.parse(code);
+ this.setState({
+ ...this.state,
+ sourceContent: code,
+ template: topologyTemplate
+ });
+ }
}
}
});
}
+
+ clear() {
+ this.setState(new DesignerDashboardState());
+ }
+
}
--- /dev/null
+<div class="scrollWrapper">
+ <div class="row m-0">
+ <div class="col">
+ <div class="form-group">
+ <label for="exampleInputEmail1">Function Instance Name</label>
+ <input type="text" class="form-control" placeholder="Function Instance Name">
+ </div>
+ <div class="form-group">
+ <label>Function Type</label>
+ <label class="attribute-value">component-resource-resolution</label>
+ </div>
+ <div class="form-group">
+ <label for="exampleFormControlTextarea1">Description</label>
+ <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
+ </div>
+ </div>
+ </div>
+ <!--INTERFACES-->
+ <div class="accordion" id="accordionExample">
+ <div class="card">
+ <div class="card-header row" id="headingOne">
+ <button class="btn btn-link" type="button" data-toggle="collapse"
+ data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
+ Interfaces
+ </button>
+ </div>
+
+ <div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
+ data-parent="#accordionExample">
+ <div class="card-body">
+ <!--Inputs & Outputs Tabs-->
+ <ul class="nav nav-pills nav-fill mb-3" id="pills-tab" role="tablist">
+ <li class="nav-item" role="presentation">
+ <a class="nav-link active" id="pills-home-tab" data-toggle="pill"
+ href="#pills-home" role="tab" aria-controls="pills-home"
+ aria-selected="true">Inputs</a>
+ </li>
+ <li class="nav-item" role="presentation">
+ <a class="nav-link" id="pills-profile-tab" data-toggle="pill"
+ href="#pills-profile" role="tab" aria-controls="pills-profile"
+ aria-selected="false">Outputs</a>
+ </li>
+ </ul>
+ <div class="tab-content" id="pills-tabContent">
+ <div class="tab-pane fade show active" id="pills-home" role="tabpanel"
+ aria-labelledby="pills-home-tab">
+ <div class="row">
+ <div class="col">
+ <!--list-->
+ <div class="attribute-wrap">
+ <div class="form-group">
+ <label
+ for="exampleFormControlTextarea1">artifact-prefix-names
+ <i class="icon-required-star" type="button"
+ aria-hidden="true"></i></label>
+ </div>
+ <div
+ class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline1"
+ name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label"
+ for="customRadioInline1">Pre-defined
+ Template</label>
+ </div>
+ <div
+ class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline2"
+ name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label"
+ for="customRadioInline2">Input Drivin
+ Template</label>
+ </div>
+ <br />
+ <button type="button" class="btn btn-select-template"><i
+ class="icon-add-circle" type="button"
+ aria-hidden="true"></i> Select Template</button>
+ </div>
+ <!--string-->
+ <div class="attribute-wrap">
+ <div class="form-group">
+ <label for="exampleInputEmail1">resoluton-key <i
+ class="icon-required-star" type="button"
+ aria-hidden="true"></i></label>
+ <input type="text" class="form-control">
+ </div>
+ </div>
+ <!--integer-->
+ <div class="attribute-wrap">
+ <div class="form-group">
+ <label for="exampleInputEmail1">request-id <i
+ class="icon-required-star" type="button"
+ aria-hidden="true"></i></label>
+ <input type="number" class="form-control" placeholder=""
+ value="356">
+ </div>
+ </div>
+ <!--boolean-->
+ <div class="attribute-wrap">
+ <div class="form-group">
+ <label
+ for="exampleFormControlTextarea1">resolution-summary
+ <i class="icon-required-star optional-attribute"
+ type="button" aria-hidden="true"></i></label>
+ </div>
+ <div
+ class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline1"
+ name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label"
+ for="customRadioInline1">True</label>
+ </div>
+ <div
+ class="custom-control custom-radio custom-control-inline">
+ <input type="radio" id="customRadioInline2"
+ name="customRadioInline1"
+ class="custom-control-input">
+ <label class="custom-control-label"
+ for="customRadioInline2">False</label>
+ </div>
+ </div>
+ <!-- Add Optional Attributes button -->
+ </div>
+ </div>
+ </div>
+ <div class="tab-pane fade" id="pills-profile" role="tabpanel"
+ aria-labelledby="pills-profile-tab">2</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!--ARTIFACTS-->
+ <div class="accordion" id="accordionExample1">
+ <div class="card">
+ <div class="card-header row" id="headingOne">
+ <button class="btn btn-link" type="button" data-toggle="collapse"
+ data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
+ Artifacts
+ </button>
+ </div>
+
+ <div id="collapseTwo" class="collapse show" aria-labelledby="headingOne"
+ data-parent="#accordionExample1">
+ <div class="card-body">
+ <div class="row">
+ <div class="col-12">
+ <a class="template-mapping-list">
+ <p>baseconfig</p>
+ <span>Mapping</span>
+ <span>Template</span>
+
+ <a data-toggle="modal"
+ data-target="#templateDeletionModal"
+ class="accordion-delete deleteTemplate"
+ title="Delete Template"><i class="icon-delete-sm"></i></a>
+ </a>
+
+ </div>
+ <div class="col-12">
+ <a class="template-mapping-list">
+ <p>vpkg</p>
+ <span>Mapping</span>
+ <span>Template</span>
+ <a data-toggle="modal"
+ data-target="#templateDeletionModal"
+ class="accordion-delete deleteTemplate"
+ title="Delete Template"><i class="icon-delete-sm"></i></a>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { FunctionsAttributeComponent } from './functions-attribute.component';
+
+describe('FunctionsAttributeComponent', () => {
+ let component: FunctionsAttributeComponent;
+ let fixture: ComponentFixture<FunctionsAttributeComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ FunctionsAttributeComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FunctionsAttributeComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import {Component, OnDestroy, OnInit} from '@angular/core';
+import {DesignerStore} from '../designer.store';
+import {PackageCreationStore} from '../../package-creation/package-creation.store';
+import {Subject} from 'rxjs';
+import {distinctUntilChanged, takeUntil} from 'rxjs/operators';
+import {CBAPackage} from '../../package-creation/mapping-models/CBAPacakge.model';
+
+@Component({
+ selector: 'app-functions-attribute',
+ templateUrl: './functions-attribute.component.html',
+ styleUrls: ['./functions-attribute.component.css']
+})
+export class FunctionsAttributeComponent implements OnInit, OnDestroy {
+
+ ngUnsubscribe = new Subject();
+ private designerDashboardState: DecodeSuccessCallback;
+ private cbaPackage: CBAPackage;
+
+ constructor(private designerStore: DesignerStore,
+ private packageCreationStore: PackageCreationStore) {
+ }
+
+ ngOnInit() {
+ this.designerStore.state$
+ .pipe(
+ distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(designerDashboardState => {
+ this.designerDashboardState = designerDashboardState;
+ });
+
+ this.packageCreationStore.state$
+ .pipe(
+ distinctUntilChanged((a: any, b: any) => JSON.stringify(a) === JSON.stringify(b)),
+ takeUntil(this.ngUnsubscribe))
+ .subscribe(cbaPackage => {
+ this.cbaPackage = cbaPackage;
+ });
+
+ }
+
+ ngOnDestroy() {
+ this.ngUnsubscribe.next();
+ this.ngUnsubscribe.complete();
+ }
+}
limitations under the License.
============LICENSE_END============================================
*/
-import { TopologyTemplate } from './model/designer.topologyTemplate.model';
-import { Injectable } from '@angular/core';
-import { GraphUtil } from './graph.util';
-import { NodeTemplate } from './model/desinger.nodeTemplate.model';
+import {TopologyTemplate} from './model/designer.topologyTemplate.model';
+import {Injectable} from '@angular/core';
+import {GraphUtil} from './graph.util';
@Injectable({
providedIn: 'root'
constructor(private graphUtil: GraphUtil) {
}
+ clear(boardGraph: joint.dia.Graph) {
+ boardGraph.clear();
+ }
+
/**
* loops over workflows
* create action element
// create action element
const actionElement =
- this.graphUtil.createCustomActionWithName(workFlowName, boardGraph);
+ this.graphUtil.createCustomActionWithName(workFlowName, boardGraph);
// create board function elements
const workflow = topologyTempalte.workflows[workFlowName].steps;
this.graphUtil.dropFunctionOverActionRelativeToParent(
actionElement,
- stepName , functionType, boardGraph);
+ stepName, functionType, boardGraph);
// TODO handle dg-generic case (multi-step in the same action)
if (functionType === 'dg-generic') {
}
private createDefinitionsFolder(cbaPackage: CBAPackage, packageCreationUtils: PackageCreationUtils) {
- cbaPackage.definitions.imports.forEach((valueOfFile, key) => {
- FilesContent.putData(key, valueOfFile);
- });
+ if (cbaPackage.definitions.imports && cbaPackage.definitions.imports.size > 0) {
+ cbaPackage.definitions.imports.forEach((valueOfFile, key) => {
+ FilesContent.putData(key, valueOfFile);
+ });
+ }
const filenameEntry = 'Definitions/' + cbaPackage.metaData.name + '.json';
const vlbDefinition: VlbDefinition = new VlbDefinition();
metadata['author-email'] = 'shaaban.eltanany.ext@orange.com';
metadata['user-groups'] = 'test';
metadata.template_description = cbaPackage.metaData.description;
- cbaPackage.metaData.mapOfCustomKey.forEach((customKeyValue, key) => {
- metadata[key] = customKeyValue;
- });
+ if (cbaPackage.metaData.mapOfCustomKey && cbaPackage.metaData.mapOfCustomKey.size > 0) {
+ cbaPackage.metaData.mapOfCustomKey.forEach((customKeyValue, key) => {
+ metadata[key] = customKeyValue;
+ });
+ }
// create Tags
let fullTags = '';
let setCount = 0;
- cbaPackage.metaData.templateTags.forEach(val => {
- setCount++;
- if (setCount === cbaPackage.metaData.templateTags.size) {
- fullTags += val;
- } else {
- fullTags += val + ', ';
- }
- });
+ if (cbaPackage.metaData.templateTags && cbaPackage.metaData.templateTags.size > 0) {
+ cbaPackage.metaData.templateTags.forEach(val => {
+ setCount++;
+ if (setCount === cbaPackage.metaData.templateTags.size) {
+ fullTags += val;
+ } else {
+ fullTags += val + ', ';
+ }
+ });
+ }
metadata.template_tags = fullTags;
vlbDefinition.metadata = metadata;
const files: Import[] = [];
- cbaPackage.definitions.imports.forEach((valueOfFile, key) => {
- if (!key.includes(cbaPackage.metaData.name)) {
- files.push({file: key});
- }
- });
- console.log(vlbDefinition);
- vlbDefinition.imports = files;
- console.log(cbaPackage.definitions.dslDefinition.content);
- if (cbaPackage.definitions.dslDefinition.content) {
+ let insideVlbDefinition: VlbDefinition = null;
+ if (cbaPackage.definitions.imports && cbaPackage.definitions.imports.size > 0) {
+ cbaPackage.definitions.imports.forEach((valueOfFile, key) => {
+ if (!key.includes(cbaPackage.metaData.name)) {
+ files.push({file: key});
+ } else {
+ insideVlbDefinition = JSON.parse(valueOfFile);
+ }
+ });
+ }
+
+ if (cbaPackage.definitions && cbaPackage.definitions.dslDefinition &&
+ cbaPackage.definitions.dslDefinition.content) {
vlbDefinition.dsl_definitions = JSON.parse(cbaPackage.definitions.dslDefinition.content);
}
- if (cbaPackage.templateTopology.content) {
+
+ vlbDefinition.imports = files;
+ if (cbaPackage.templateTopology && cbaPackage.templateTopology.content) {
vlbDefinition.topology_template = JSON.parse(cbaPackage.templateTopology.content);
+ } else if (insideVlbDefinition && insideVlbDefinition.topology_template) {
+ vlbDefinition.topology_template = insideVlbDefinition.topology_template;
}
- console.log(vlbDefinition);
+
const value = packageCreationUtils.transformToJson(vlbDefinition);
FilesContent.putData(filenameEntry, value);
- console.log('hello there');
console.log(FilesContent.getMapOfFilesNamesAndContent());
-
}
}
-import { CBAPackage } from '../mapping-models/CBAPacakge.model';
-import { ModeType } from '../mapping-models/ModeType';
-import { FilesContent, MetaDataTabModel } from '../mapping-models/metadata/MetaDataTab.model';
-import { PackageCreationUtils } from '../package-creation.utils';
+import {CBAPackage} from '../mapping-models/CBAPacakge.model';
+import {ModeType} from '../mapping-models/ModeType';
+import {FilesContent, MetaDataTabModel} from '../mapping-models/metadata/MetaDataTab.model';
+import {PackageCreationUtils} from '../package-creation.utils';
export abstract class PackageCreationModes {
public static mapModeType(cbaPackage: CBAPackage) {
console.log(cbaPackage.metaData.mode);
- if (cbaPackage.metaData.mode.includes('Scripting')) {
- cbaPackage.metaData.mode = ModeType.Scripting;
- } else if (cbaPackage.metaData.mode.includes('Designer') || cbaPackage.metaData.mode.includes('DEFAULT') ) {
- cbaPackage.metaData.mode = ModeType.Designer;
- } else {
- cbaPackage.metaData.mode = ModeType.Generic;
- }
+ /* if (cbaPackage.metaData.mode.includes('Scripting')) {
+ cbaPackage.metaData.mode = ModeType.Scripting;
+ } else if (cbaPackage.metaData.mode.includes('Designer') || cbaPackage.metaData.mode.includes('DEFAULT') ) {
+ cbaPackage.metaData.mode = ModeType.Designer;
+ } else {
+ cbaPackage.metaData.mode = ModeType.Generic;
+ }*/
+ cbaPackage.metaData.mode = ModeType.Designer;
return cbaPackage;
}
getValueOfMetaData(metaDataTab: MetaDataTabModel): string {
let tags = '';
let count = 0;
- for (const tag of metaDataTab.templateTags) {
- count++;
- if (count === metaDataTab.templateTags.size) {
- tags += tag;
- } else {
- tags += tag + ', ';
+ if (metaDataTab.templateTags && metaDataTab.templateTags.size > 0) {
+ for (const tag of metaDataTab.templateTags) {
+ count++;
+ if (count === metaDataTab.templateTags.size) {
+ tags += tag;
+ } else {
+ tags += tag + ', ';
+ }
}
}
return 'TOSCA-Meta-File-Version: 1.0.0\n' +
<div [id]="'id-'+mapIndex" class="collapse" [attr.aria-labelledby]="'head-'+mapIndex"
data-parent="#accordion">
<div class="card-body">
- <ace-editor [(text)]="file.value" (textChange)="textChanges($event,file.key)" [mode]="'json'"
+ <ace-editor [(text)]="file.value" readOnly="true" (textChange)="textChanges($event,file.key)" [mode]="'json'"
[autoUpdateContent]="true" [durationBeforeCallback]="1000" [theme]="'eclipse'"
#editor style="height:300px;">
</ace-editor>
-import { Any, JsonObject, JsonProperty } from 'json2typescript';
+import {JsonObject, JsonProperty} from 'json2typescript';
@JsonObject('topology_template')
export class TemplateTopology {
- public content: string;
+ // tslint:disable-next-line:variable-name
+ public node_templates: object;
+ public workflows: object;
+ public content: string ;
}
@JsonObject
export class DslContent {
}
+
// Refactor varaibles name and use JsonConverteri
@JsonObject('metadata')
export class Metadata {
@JsonProperty('template_author')
- // tslint:disable-next-line:variable-name
+ // tslint:disable-next-line:variable-name
template_author: string;
'author-email': string;
'user-groups': string;
@JsonProperty('template_name')
- // tslint:disable-next-line:variable-name
+ // tslint:disable-next-line:variable-name
template_name: string;
@JsonProperty('template_version')
- // tslint:disable-next-line:variable-name
+ // tslint:disable-next-line:variable-name
template_version: string;
@JsonProperty('template_tag')
- // tslint:disable-next-line:variable-name
+ // tslint:disable-next-line:variable-name
template_tags: string;
@JsonProperty('dictionary_group')
- // tslint:disable-next-line:variable-name
+ // tslint:disable-next-line:variable-name
dictionary_group: string;
@JsonProperty('template_tags')
templateTags: string;
private dependanciesSource: Map<string, string>) { }
ToMapping(): Mapping {
+ // console.log(this.resourceDictionary.definition.property);
const mapping = new Mapping();
mapping.name = this.resourceDictionary.name;
mapping.dictionaryName = this.resourceDictionary.name;
- mapping.property = this.resourceDictionary.definition.property;
- mapping.inputParam = false;
+ mapping.property = Object.assign({}, this.resourceDictionary.definition.property);
+ mapping.inputParam = this.resourceDictionary['input-param'] || false;
+ // tslint:disable-next-line: no-string-literal
+ mapping.property['required'] = this.resourceDictionary['required'] || false;
mapping.dictionarySource = this.dependanciesSource.get(mapping.name);
if (this.dependancies.get(mapping.name)) {
mapping.dependencies = this.dependancies.get(mapping.name);
<div class="single-line-model">
<label class="label-name">Name <span>*</span></label>
<div class="label-input">
- <input tourAnchor="mt-packageName" type="input" (change)="checkRequiredElements()"
+ <input tourAnchor="mt-packageName" type="input" [readOnly]="!isNameEditable" (change)="checkRequiredElements()"
[(ngModel)]="metaDataTab.name" placeholder="Package name">
</div>
<!--<div class="model-note-container error-message">
[(ngModel)]="metaDataTab.version" (input)="validatePackageNameAndVersion()"
pattern="(\d+)\.(\d+)\.(\d+)" placeholder="Example: 1.0.0">
</div>
+ <div class="model-note-container tag-notes">Must follow this format (1.0.0)</div>
<div class="model-note-container error-message">{{errorMessage}}</div>
</div>
<div class="single-line-model">
</div>
</div>
-</div>
\ No newline at end of file
+</div>
metaDataTab: MetaDataTabModel = new MetaDataTabModel();
errorMessage: string;
versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$';
+ isNameEditable = false;
constructor(
private route: ActivatedRoute,
this.metaDataTab.templateTags = this.tags;
this.metaDataTab.mapOfCustomKey = this.customKeysMap;
this.metaDataTab.mode = this.modeType;
-
+ this.isNameEditable = this.route.snapshot.paramMap.get('id') == null;
this.packageCreationStore.state$.subscribe(element => {
if (element && element.metaData) {
this.tags = element.metaData.templateTags;
this.tags.delete('');
this.metaDataTab.templateTags = this.tags;
- console.log(element);
if (element.metaData.mode && element.metaData.mode.includes('DEFAULT')) {
this.metaDataTab.mode = 'Designer Mode';
this.modeType = this.metaDataTab.mode;
this.customKeysMap = element.metaData.mapOfCustomKey;
this.metaDataTab.mapOfCustomKey = this.customKeysMap;
+ /* if (this.isNameEditable) {
+ this.validatePackageNameAndVersion();
+ }*/
// this.tags = element.metaData.templateTags;
+
}
});
}
}
validatePackageNameAndVersion() {
+ console.log('in validate');
+ console.log('in this.metaDataTab.name' + this.metaDataTab.name);
if (this.metaDataTab.name && this.metaDataTab.version) {
this.packageCreationService.checkBluePrintNameAndVersion(this.metaDataTab.name, this.metaDataTab.version).then(element => {
if (element) {
--- /dev/null
+import {Injectable, ViewChild} from '@angular/core';
+import {MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model';
+import {TemplateTopology, VlbDefinition} from './mapping-models/definitions/VlbDefinition';
+import {DslDefinition} from './mapping-models/CBAPacakge.model';
+import {PackageCreationStore} from './package-creation.store';
+import * as JSZip from 'jszip';
+import {PackageCreationUtils} from './package-creation.utils';
+import {MetadataTabComponent} from './metadata-tab/metadata-tab.component';
+import {DesignerStore} from '../designer/designer.store';
+import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PackageCreationExtractionService {
+
+ private zipFile: JSZip;
+ private entryDefinitionKeys: string[] = ['template_tags', 'user-groups',
+ 'author-email', 'template_version', 'template_name', 'template_author', 'template_description'];
+
+ private toscaMetaDataKeys: string[] = ['TOSCA-Meta-File-Version', 'CSAR-Version',
+ 'Created-By', 'Entry-Definitions', 'Template-Name', 'Template-Version', 'Template-Type', 'Template-Tags'];
+ @ViewChild(MetadataTabComponent, {static: false})
+ private metadataTabComponent: MetadataTabComponent;
+
+ constructor(
+ private packageCreationStore: PackageCreationStore,
+ private packageCreationUtils: PackageCreationUtils,
+ private designerStore: DesignerStore
+ ) {
+
+ }
+
+ public extractBlobToStore(blob) {
+ this.zipFile = new JSZip();
+ let packageName = null;
+ this.zipFile.loadAsync(blob).then((zip) => {
+ Object.keys(zip.files).filter(fileName => fileName.includes('TOSCA-Metadata/'))
+ .forEach((filename) => {
+ zip.files[filename].async('string').then((fileData) => {
+ if (fileData) {
+ if (filename.includes('TOSCA-Metadata/')) {
+
+ const metaDataTabInfo: MetaDataTabModel = this.getMetaDataTabInfo(fileData);
+ packageName = metaDataTabInfo.name;
+ this.setMetaData(metaDataTabInfo);
+ console.log('found file ' + packageName);
+ }
+ }
+ });
+ });
+ });
+
+ this.zipFile.loadAsync(blob).then((zip) => {
+ Object.keys(zip.files).forEach((filename) => {
+ zip.files[filename].async('string').then((fileData) => {
+ console.log(filename);
+ if (fileData) {
+ if (filename.includes('Scripts/')) {
+ this.setScripts(filename, fileData);
+ } else if (filename.includes('Templates/')) {
+ if (filename.includes('-mapping.')) {
+ this.setMapping(filename, fileData);
+ } else if (filename.includes('-template.')) {
+ this.setTemplates(filename, fileData);
+ }
+
+ } else if (filename.includes('Definitions/')) {
+ this.setImports(filename, fileData, packageName);
+ }
+ }
+ });
+ });
+ });
+ }
+
+ public setScripts(filename: string, fileData: any) {
+ this.packageCreationStore.addScripts(filename, fileData);
+ }
+
+ public setImports(filename: string, fileData: any, packageName: string) {
+ console.log(filename);
+ if (filename.includes('Definitions/' + packageName.trim() + '.json')) {
+ let definition = new VlbDefinition();
+ definition = fileData as VlbDefinition;
+ definition = JSON.parse(fileData);
+ const dslDefinition = new DslDefinition();
+ dslDefinition.content = this.packageCreationUtils.transformToJson(definition.dsl_definitions);
+ const mapOfCustomKeys = new Map<string, string>();
+ for (const metadataKey in definition.metadata) {
+ if (!this.entryDefinitionKeys.includes(metadataKey + '')) {
+ mapOfCustomKeys.set(metadataKey + '', definition.metadata[metadataKey + '']);
+ }
+ }
+
+ this.packageCreationStore.changeDslDefinition(dslDefinition);
+ this.packageCreationStore.setCustomKeys(mapOfCustomKeys);
+ this.setPackageDescription(definition.metadata.template_description);
+ console.log(definition);
+ console.log(definition.topology_template);
+ const content = {};
+ const workflow = 'workflows';
+ content[workflow] = definition.topology_template ? definition.topology_template.workflows : {};
+ const nodeTemplates = 'node_templates';
+ content[nodeTemplates] = definition.topology_template ? definition.topology_template.node_templates : {};
+ this.designerStore.saveSourceContent(JSON.stringify(content));
+ if (definition.topology_template) {
+ this.packageCreationStore.addTopologyTemplate(definition.topology_template);
+ } else {
+ this.packageCreationStore.addTopologyTemplate(new TemplateTopology());
+ }
+
+
+ }
+ this.packageCreationStore.addDefinition(filename, fileData);
+
+ }
+
+ public setTemplates(filename: string, fileData: any) {
+ this.packageCreationStore.addTemplate(filename, fileData);
+ }
+
+ public setMapping(fileName: string, fileData: string) {
+ this.packageCreationStore.addMapping(fileName, fileData);
+ }
+
+ private setMetaData(metaDataObject: MetaDataTabModel) {
+ this.packageCreationStore.changeMetaData(metaDataObject);
+ }
+
+ public setMetaDataWithObject(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BluePrintDetailModel) {
+ metaDataObject.description = bluePrintDetailModel.artifactDescription;
+ this.packageCreationStore.changeMetaData(metaDataObject);
+
+ }
+
+ public getMetaDataTabInfo(fileData: string) {
+ const metaDataTabModel = new MetaDataTabModel();
+
+ const arrayOfLines = fileData.split('\n');
+ const map = new Map<string, string>();
+ for (const currentLine of arrayOfLines) {
+ const currentKey = currentLine.split(':')[0];
+ const currentValue = currentLine.split(':')[1];
+ map.set(currentKey, currentValue);
+ }
+ metaDataTabModel.entryFileName = map.get(this.toscaMetaDataKeys[3]);
+ metaDataTabModel.name = map.get(this.toscaMetaDataKeys[4]);
+ metaDataTabModel.version = map.get(this.toscaMetaDataKeys[5]).trim();
+ metaDataTabModel.mode = map.get(this.toscaMetaDataKeys[6]);
+ if (map.get(this.toscaMetaDataKeys[7])) {
+ metaDataTabModel.templateTags = new Set<string>(map.get(this.toscaMetaDataKeys[7]).split(','));
+ }
+ return metaDataTabModel;
+ }
+
+ private setPackageDescription(templateDescription: string) {
+ const metaData = this.packageCreationStore.getMetaData();
+ metaData.description = templateDescription;
+ this.setMetaData(metaData);
+
+ }
+}
<input class="dropdown-toggle" type="text">
<div class="dropdown-text"><i class="icon-info" aria-hidden="true"></i></div>
<ul class="dropdown-content">
+ <li>
+ <i class="icon-get_started" aria-hidden="true"></i>
+ <p>
+ <input id="clicker3" type="checkbox" />
+ <label for="clicker">
+ Getting Started
+ <span>Quick steps to help you get started</span>
+ </label>
+ </p>
+ </li>
<!-- <li>
<i class="icon-get_started" aria-hidden="true"></i>
<p>
<div class="nav nav-tabs " id="nav-tab" role="tablist">
<a (click)="openTourGuide('metadataTab')" tourAnchor="metadataTab" class="nav-item nav-link active"
id="nav-metadata-tab" data-toggle="tab" href="#nav-metadata" role="tab" aria-controls="nav-metadata"
- aria-selected="false" autofocus #nameit (focusout)="saveMetaData()"
- [classList]="metadataClasses">METADATA</a>
+ aria-selected="false" autofocus #nameit (focusout)="saveMetaData()" [classList]="metadataClasses">METADATA</a>
+
+
<a (click)="openTourGuide('tm-templateTab')" tourAnchor="tm-templateTab" class="nav-item nav-link"
id="nav-template-tab" data-toggle="tab" href="#nav-template" role="tab" aria-controls="nav-template"
aria-selected="false">TEMPLATE &
</div>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
============LICENSE_END============================================
*/
-import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
-import { FilesContent, FolderNodeElement, MetaDataTabModel } from './mapping-models/metadata/MetaDataTab.model';
+import {Component, ElementRef, OnDestroy, OnInit, ViewChild} from '@angular/core';
+import {FilesContent, FolderNodeElement, MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model';
import * as JSZip from 'jszip';
-import { PackageCreationStore } from './package-creation.store';
-import { Definition } from './mapping-models/CBAPacakge.model';
-import { PackageCreationModes } from './creationModes/PackageCreationModes';
-import { PackageCreationBuilder } from './creationModes/PackageCreationBuilder';
-import { PackageCreationUtils } from './package-creation.utils';
-import { MetadataTabComponent } from './metadata-tab/metadata-tab.component';
-import { Router } from '@angular/router';
-import { ToastrService } from 'ngx-toastr';
-import { TourService } from 'ngx-tour-md-menu';
+import {PackageCreationStore} from './package-creation.store';
+import {CBAPackage, Definition} from './mapping-models/CBAPacakge.model';
+import {PackageCreationModes} from './creationModes/PackageCreationModes';
+import {PackageCreationBuilder} from './creationModes/PackageCreationBuilder';
+import {PackageCreationUtils} from './package-creation.utils';
+import {MetadataTabComponent} from './metadata-tab/metadata-tab.component';
+import {Router} from '@angular/router';
+import {ToastrService} from 'ngx-toastr';
+import {TourService} from 'ngx-tour-md-menu';
+import {PackageCreationService} from './package-creation.service';
+import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate';
+import {DesignerStore} from '../designer/designer.store';
@Component({
templateUrl: './package-creation.component.html',
styleUrls: ['./package-creation.component.css']
})
-export class PackageCreationComponent implements OnInit {
+export class PackageCreationComponent extends ComponentCanDeactivate implements OnInit, OnDestroy {
+
// adding initial referencing to designer mode
constructor(
private packageCreationStore: PackageCreationStore,
+ private packageCreationService: PackageCreationService,
private packageCreationUtils: PackageCreationUtils,
private router: Router,
private tourService: TourService,
- private toastService: ToastrService) {
+ private toastService: ToastrService,
+ private designerStore: DesignerStore) {
+
+ super();
}
counter = 0;
modes: object[] = [
- { name: 'Designer Mode', style: 'mode-icon icon-designer-mode' },
- { name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode' }];
+ {name: 'Designer Mode', style: 'mode-icon icon-designer-mode'},
+ {name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode'}];
metaDataTab: MetaDataTabModel = new MetaDataTabModel();
folder: FolderNodeElement = new FolderNodeElement();
zipFile: JSZip = new JSZip();
definition: Definition = new Definition();
isSaveEnabled = false;
- @ViewChild(MetadataTabComponent, { static: false })
+ @ViewChild(MetadataTabComponent, {static: false})
metadataTabComponent: MetadataTabComponent;
- @ViewChild('nameit', { static: true })
+ @ViewChild('nameit', {static: true})
elementRef: ElementRef;
versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$';
metadataClasses = 'nav-item nav-link active complete';
+ private cbaPackage: CBAPackage;
ngOnInit() {
this.elementRef.nativeElement.focus();
const regexp = RegExp(this.versionPattern);
this.packageCreationStore.state$.subscribe(cbaPackage => {
+ console.log(cbaPackage);
+ console.log('abbaaaas' + cbaPackage.metaData.name);
+ this.cbaPackage = cbaPackage;
if (cbaPackage && cbaPackage.metaData && cbaPackage.metaData.description
&& cbaPackage.metaData.name && cbaPackage.metaData.version &&
regexp.test(cbaPackage.metaData.version)) {
}
saveBluePrint() {
- this.packageCreationStore.state$.subscribe(
- cbaPackage => {
- console.log(cbaPackage);
- FilesContent.clear();
- let packageCreationModes: PackageCreationModes;
- cbaPackage = PackageCreationModes.mapModeType(cbaPackage);
- cbaPackage.metaData = PackageCreationModes.setEntryPoint(cbaPackage.metaData);
- packageCreationModes = PackageCreationBuilder.getCreationMode(cbaPackage);
- packageCreationModes.execute(cbaPackage, this.packageCreationUtils);
- this.filesData.push(this.folder.TREE_DATA);
- this.saveBluePrintToDataBase();
- });
+ console.log(this.cbaPackage);
+ FilesContent.clear();
+ let packageCreationModes: PackageCreationModes;
+ this.cbaPackage = PackageCreationModes.mapModeType(this.cbaPackage);
+ this.cbaPackage.metaData = PackageCreationModes.setEntryPoint(this.cbaPackage.metaData);
+ packageCreationModes = PackageCreationBuilder.getCreationMode(this.cbaPackage);
+
+ // this.cbaPackage.templateTopology.content = this.designerStore.state.sourceContent;
+ packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils);
+ this.filesData.push(this.folder.TREE_DATA);
+ this.saveBluePrintToDataBase();
}
saveBluePrintToDataBase() {
this.create();
- this.zipFile.generateAsync({ type: 'blob' })
+ this.zipFile.generateAsync({type: 'blob'})
.then(blob => {
- this.packageCreationStore.saveBluePrint(blob).subscribe(
+ this.packageCreationService.savePackage(blob).subscribe(
bluePrintDetailModels => {
if (bluePrintDetailModels) {
const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
this.toastService.info('package updated successfully ');
+ this.isSaveEnabled = false;
this.router.navigate(['/packages/package/' + id]);
}
}, error => {
this.metadataTabComponent.saveMetaDataToStore();
}
+
+ canDeactivate(): boolean {
+ return this.isSaveEnabled;
+ }
+
+ ngOnDestroy(): void {
+
+ }
}
import {Injectable} from '@angular/core';
-import {Observable} from 'rxjs';
+import {Observable, Subject} from 'rxjs';
import {ApiService} from '../../../../common/core/services/api.service';
import {BlueprintURLs, ResourceDictionaryURLs} from '../../../../common/constants/app-constants';
import {PackagesApiService} from '../packages-api.service';
import {PackagesStore} from '../packages.store';
import {ResourceDictionary} from './mapping-models/ResourceDictionary.model';
+import {FilesContent, FolderNodeElement} from './mapping-models/metadata/MetaDataTab.model';
+import {PackageCreationModes} from './creationModes/PackageCreationModes';
+import {PackageCreationBuilder} from './creationModes/PackageCreationBuilder';
+import {PackageCreationStore} from './package-creation.store';
+import {CBAPackage} from './mapping-models/CBAPacakge.model';
+import {PackageCreationUtils} from './package-creation.utils';
+import * as JSZip from 'jszip';
+import {DesignerStore} from '../designer/designer.store';
@Injectable({
providedIn: 'root'
})
export class PackageCreationService {
-
-
- constructor(private api: ApiService, private packagesListService: PackagesApiService, private packagesStore: PackagesStore) {
+ private cbaPackage: CBAPackage;
+ folder: FolderNodeElement = new FolderNodeElement();
+ filesData: any = [];
+ zipFile: JSZip = new JSZip();
+
+ constructor(private api: ApiService, private packagesListService: PackagesApiService,
+ private packagesStore: PackagesStore, private designerStore: DesignerStore,
+ private packageCreationStore: PackageCreationStore, private packageCreationUtils: PackageCreationUtils
+ ) {
+ this.packageCreationStore.state$.subscribe(
+ cbaPackage => {
+ this.cbaPackage = cbaPackage;
+ });
}
- private saveBlueprint(body: any | null, options?: any): Observable<any> {
+ private saveBlueprint(body: any | null, options?: any): Observable<string> {
return this.api.post(BlueprintURLs.save, body, {responseType: 'text'});
}
private enrichBlueprint(body: any | null, options?: any): Observable<any> {
- return this.api.post(BlueprintURLs.enrich, body, {responseType: 'text'});
+ return this.api.post(BlueprintURLs.enrich, body, {responseType: 'blob'});
}
private deployBluePrint(body: any | null, options?: any): Observable<any> {
this.packagesStore.getAll();
}
- savePackage(blob) {
+ public savePackage(blob): Observable<string> {
const formData = this.getFormData(blob);
return this.saveBlueprint(formData);
}
return this.api.post(ResourceDictionaryURLs.searchResourceDictionaryByNames, variables);
}
+ downloadPackage(id) {
+ return this.api.getCustomized(BlueprintURLs.download + id, {responseType: 'blob'});
+ }
+
+ public saveBluePrintToDataBase(): Observable<string> {
+ this.formTreeData();
+ this.create();
+ const subject = new Subject<any>();
+ this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ this.savePackage(blob).subscribe(bluePrintModel => {
+ subject.next(bluePrintModel);
+ });
+ });
+ return subject.asObservable();
+ }
+
+ public deployCurrentPackage() {
+ this.formTreeData();
+ this.create();
+ const subject = new Subject<any>();
+ this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ this.deploy(blob).subscribe(bluePrintModel => {
+ subject.next(bluePrintModel);
+ });
+ });
+ return subject.asObservable();
+ }
+
+ public enrichCurrentPackage() {
+ this.formTreeData();
+ this.create();
+ const subject = new Subject<any>();
+ return this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ return this.enrichPackage(blob).pipe();
+ });
+ // return subject.asObservable();
+
+ }
+
+ private create() {
+ this.zipFile = new JSZip();
+ FilesContent.getMapOfFilesNamesAndContent().forEach((value, key) => {
+ this.zipFile.folder(key.split('/')[0]);
+ this.zipFile.file(key, value);
+ });
+
+ }
+
+ private formTreeData() {
+
+ FilesContent.clear();
+ let packageCreationModes: PackageCreationModes;
+ this.cbaPackage = PackageCreationModes.mapModeType(this.cbaPackage);
+ this.cbaPackage.metaData = PackageCreationModes.setEntryPoint(this.cbaPackage.metaData);
+ packageCreationModes = PackageCreationBuilder.getCreationMode(this.cbaPackage);
+ this.designerStore.state$.subscribe(state => {
+ this.cbaPackage.templateTopology.content = this.packageCreationUtils.transformToJson(state.template);
+ });
+ packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils);
+ this.filesData.push(this.folder.TREE_DATA);
+ }
}
import {Store} from '../../../../common/core/stores/Store';
import {CBAPackage, DslDefinition} from './mapping-models/CBAPacakge.model';
-import {PackageCreationService} from './package-creation.service';
import {MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model';
-import {Observable} from 'rxjs';
-import {ResourceDictionary} from './mapping-models/ResourceDictionary.model';
-import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
import {TemplateTopology} from './mapping-models/definitions/VlbDefinition';
export class PackageCreationStore extends Store<CBAPackage> {
- constructor(private packageCreationService: PackageCreationService) {
+ constructor() {
super(new CBAPackage());
}
this.state.definitions.imports.delete(filename);
}
- saveBluePrint(blob): Observable<BluePrintDetailModel> {
- return this.packageCreationService.savePackage(blob);
- }
-
- enrichBluePrint(blob): Observable<any> {
- return this.packageCreationService.enrichPackage(blob);
- }
-
- deployBluePrint(blob): Observable<BluePrintDetailModel> {
- return this.packageCreationService.deploy(blob);
- }
addTemplate(filePath: string, fileContent: string) {
this.setState({
});
}
- getTemplateAndMapping(variables: string[]): Observable<ResourceDictionary[]> {
- return this.packageCreationService.getTemplateAndMapping(variables);
- }
-
clear() {
+ console.log('clearing the store');
this.setState(new CBAPackage());
+ console.log('it should be empty');
}
setEntryDefinition(data: string) {
templateTopology
});
}
+
+ getMetaData() {
+ return this.state.metaData;
+ }
}
ngOnInit() {
+
this.packageCreationStore.state$.subscribe(cbaPackage => {
if (cbaPackage.scripts && cbaPackage.scripts.files && cbaPackage.scripts.files.size > 0) {
this.scriptsFiles = cbaPackage.scripts.files;
// based on edit Mode, edit=false
mode = new BehaviorSubject(false);
list = new BehaviorSubject('');
+ modeState: Observable<boolean>;
+ listState: Observable<string>;
constructor() {
+ this.mode = new BehaviorSubject(false);
+ this.list = new BehaviorSubject('');
+ this.modeState = this.mode.asObservable();
+ this.listState = this.list.asObservable();
}
isEdit(): Observable<boolean> {
- return this.mode.asObservable();
+ return this.modeState;
}
enableEdit() {
this.mode.next(true);
this.list.next(filename);
}
listAction(): Observable<string> {
- return this.list.asObservable();
+ return this.listState;
}
}
+++ /dev/null
-export enum TemplateType {
- Velocity = 'vtl',
- Koltin = 'kt',
- Jinja = 'Unknown'
-}
class="fa fa-chevron-left mr-2"></i>Template List</button>
</div>
<div class="col text-right">
+ <button (click)="cancel()" [hidden]="!templatesExist || edit" class="btn btn-outline-danger"
+ title="Delete Template">Cancel</button>
<button data-toggle="modal" [hidden]="!edit" data-target="#templateDeletionModal2"
class="btn btn-outline-danger" title="Delete Template">Delete</button>
- <button (click)="cancel()" [hidden]="fileName?.length <=0 || edit"
+ <button (click)="clear()" [hidden]="fileName?.length <=0 || edit"
class="btn btn-outline-secondary">Clear</button>
- <button tourAnchor="tm-templateFinish" (click)="saveToStore()" [disabled]="fileName?.length <=0" title="Submit template and close"
- class="btn btn-primary">Finish</button>
+ <button tourAnchor="tm-templateFinish" (click)="saveToStore()" [disabled]="fileName?.length <=0"
+ title="Submit template and close" class="btn btn-primary">Finish</button>
</div>
</div>
<div class="card creat-card">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0 d-flex justify-content-between">
- <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true"
- aria-controls="collapseOne">
+ <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" id="templateTab"
+ aria-expanded="true" aria-controls="collapseOne">
1. Template <span class="accordian-title">{{currentTemplate?.fileName?.split('/')[1]}}</span>
</button>
<div tourAnchor="tm-templateType" class="single-line">
<label class="label-name">Template Type</label>
<div class="label-input">
- <label name="trst" (click)="allowedExt=['.vtl']">
+ <label name="trst" (click)="allowedExt=['.vtl'];templateExt='vtl'">
<input class="form-check-input" [(ngModel)]="templateExt" type="radio"
- name="exampleRadios" id="exampleRadios1" value=Velcoity>
+ name="exampleRadios" id="exampleRadios1" value=vtl>
<span>
- Velcoity
+ Velocity
</span>
</label>
- <label name="trst" (click)="allowedExt=['.j2','.jinja2']">
+ <label name="trst" (click)="allowedExt=['.j2','.jinja2'];templateExt='j2'">
<input class="form-check-input" [(ngModel)]="templateExt" type="radio"
- name="exampleRadios" id="exampleRadios1" value=Jinja>
+ name="exampleRadios" id="exampleRadios1" value=j2>
<span>
Jinja
</span>
</label>
- <label tourAnchor="tm-templateContent" name="trst" (click)="allowedExt=['.kt']">
+ <label tourAnchor="tm-templateContent" name="trst"
+ (click)="allowedExt=['.kt'];templateExt='kt'">
<input class="form-check-input" [(ngModel)]="templateExt" type="radio"
- name="exampleRadios" id="exampleRadios1" value=Kotlin>
+ name="exampleRadios" id="exampleRadios1" value=kt>
<span>
Kotlin
</div>
</div>
<div class="create-template-import">Use the editor to add parameters or you can also
- <a href="#" data-toggle="modal" (click)="allowedExt=[getFileExtension()]"
+ <a href="#" data-toggle="modal" (click)="allowedExt=['.'+templateExt]"
data-target="#templateModal"><b>Import
File</b></a>. <br /> <span class="templateNote"><i class="icon-info"
aria-hidden="true"></i> When you import new file, the new attributes will replace
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
- <button tourAnchor="tm-mappingContent" class="btn btn-link collapsed" id="mappingTab" data-toggle="collapse"
- data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
+ <button tourAnchor="tm-mappingContent" class="btn btn-link collapsed" id="mappingTab"
+ data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
+ aria-controls="collapseTwo">
2. Manage Mapping <span
class="accordian-title">{{currentMapping?.fileName?.split('/')[1]}}</span>
</button>
<div class="card-body">
<p class="text-center"><b>Select a source to load config parameters</b></p>
<div class="text-center">
- <button [disabled]="!(variables?.length>0 && templateFileContent?.trim()?.length > 0)"
- (click)="getMappingTableFromTemplate($event)" class="mapping-source-load" [ngClass]="variables?.length>0 && templateFileContent?.trim()?.length > 0
+ <button [disabled]="!(templateFileContent?.trim()?.length > 0)"
+ (click)="getMappingTableFromTemplate($event)" class="mapping-source-load" [ngClass]="templateFileContent?.trim()?.length > 0
?'hover-enable':'hover-disable'">
<i class="icon-use-attributes"></i>
<br />
</div>
+
</div>
+
<div id="mapping-table" [hidden]="resourceDictionaryRes?.length == 0" class="mapping-table mx-4 my-2">
+ <div class="btn-group mapping-editBar" role="group">
+ <div class="custom-control custom-checkbox" tooltip="Select All" placement="bottom">
+ <input type="checkbox" (click)="selectAllProps()" class="custom-control-input"
+ id="customCheck1"
+ [checked]="resourceDictionaryRes.length>0&&resourceDictionaryRes.length === this.selectedProps.size">
+ <label class="custom-control-label" for="customCheck1"></label>
+ </div>
+ <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="reMap()"
+ tooltip="Re-mapping" placement="bottom"><i class="icon-autoMap"></i></button>
+ <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="removeProps()"
+ tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button>
+ <div style="line-height: 35px;font-size: 10px;">
+ <span>{{selectedProps.size}} selected </span>
+ <span>({{resourceDictionaryRes.length}} attributes in total)</span>
+ </div>
+ </div>
<table datatable [dtOptions]="initDtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
<thead>
<tr>
+ <th></th>
<th>Required</th>
+ <th>Template Input</th>
<th>Parameter Name</th>
<th>Dictionary Name</th>
<th>Dictionary Source</th>
<th>Dependancies</th>
<th>Default</th>
+ <th>Velocity</th>
<th>Data Type</th>
<th>Entry Schema</th>
</tr>
</thead>
<tbody>
- <tr *ngFor="let dict of resourceDictionaryRes">
+ <tr *ngFor="let dict of resourceDictionaryRes;let i=index;trackBy: identify">
+ <td>
+ <div class="custom-control custom-checkbox" tooltip="Select" placement="bottom">
+ <input type="checkbox" class="custom-control-input"
+ id="customCheck-{{dict.name}}" [checked]="selectedProps.has(dict.name)"
+ (click)="selectProp(dict.name)">
+ <label class="custom-control-label" for="customCheck-{{dict.name}}"></label>
+ </div>
+ <!-- <input type="checkbox" [checked]="selectedProps.has(dict.name)"
+ (click)="selectProp(dict.name)"></td> -->
+ </td>
<td>
- <img *ngIf="dict.definition?.property?.required"
- src="/assets/img/icon-required-yes.svg">
- <img *ngIf="!dict.definition?.property?.required"
- src="/assets/img/icon-required-no.svg">
+ <div class="custom-control custom-checkbox reuiredInput">
+ <input type="checkbox" class="custom-control-input" #requiredInput
+ (click)="setProp(requiredInput,'required',i)"
+ id="requiredCheck-{{dict.name}}">
+ <label class="custom-control-label" for="requiredCheck-{{dict.name}}"></label>
+ </div>
+ </td>
+ <td>
+ <div class="custom-control custom-checkbox reuiredInput">
+ <input type="checkbox" class="custom-control-input" #tempInput
+ (click)="setProp(tempInput,'input-param',i)" id="inputCheck-{{dict.name}}">
+ <label class="custom-control-label" for="inputCheck-{{dict.name}}"></label>
+ </div>
</td>
<td>{{ dict.name }}</td>
<td>{{ dict.name }}</td>
<!-- <select class="custom-select">
<option *ngFor="let val of getKeys(dependancies)">
{{ getValue(dict.name)}}</option>
-
</select> -->
<input type="text" class="form-control" [ngModel]="getValue(dict.name)">
<!-- {{ dict.definition.sources }} -->
</td>
<td>{{ dict.definition?.property?.default }}</td>
+ <td><input type="text" class="form-control" #velocity
+ (input)="setVelocity(i,velocity.value)"></td>
<td>{{ dict.definition?.property?.type }}</td>
<td>{{ dict.definition?.property['entry_schema'] }}</td>
</tr>
</div>
<div id="mapping-table-res" [hidden]="mappingRes?.length == 0" class="mapping-table mx-4 my-2">
+ <!-- <div class="btn-group mapping-editBar" role="group">
+ <div class="custom-control custom-checkbox" tooltip="Select All" placement="bottom">
+ <input type="checkbox" (click)="selectAllProps()" class="custom-control-input"
+ id="customCheck2"
+ [checked]="resourceDictionaryRes.length>0&&resourceDictionaryRes.length === this.selectedProps.size">
+ <label class="custom-control-label" for="customCheck2"></label>
+ </div>
+ <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="reMap()"
+ tooltip="Re-mapping" placement="bottom"><i class="icon-autoMap"></i></button>
+ <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="removeProps()"
+ tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button>
+ </div> -->
<table datatable [dtOptions]="dtOptions" [dtTrigger]="resTableDtTrigger" class="row-border hover">
<thead>
<tr>
+ <!-- <th></th> -->
<th>Required</th>
+ <th>Template Input</th>
<th>Parameter Name</th>
<th>Dictionary Name</th>
<th>Dictionary Source</th>
<th>Dependancies</th>
<th>Default</th>
+ <th>Velocity</th>
<th>Data Type</th>
<th>Entry Schema</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let dict of mappingRes">
+ <!-- <td>
+ <div class="custom-control custom-checkbox" tooltip="Select" placement="bottom">
+ <input type="checkbox" class="custom-control-input"
+ id="customCheck2-{{dict.name}}" [checked]="selectedProps.has(dict.name)"
+ (click)="selectProp(dict.name)">
+ <label class="custom-control-label" for="customCheck2-{{dict.name}}"></label>
+ </div>
+ </td> -->
<td>
- <img *ngIf="dict.definition?.property?.required"
- src="/assets/img/icon-required-yes.svg">
- <img *ngIf="!dict.definition?.property?.required"
- src="/assets/img/icon-required-no.svg">
+ <img *ngIf="dict?.property?.required" src="/assets/img/icon-required-yes.svg">
+ <img *ngIf="!dict?.property?.required" src="/assets/img/icon-required-no.svg">
+ </td>
+ <td>
+ <img *ngIf="dict['input-param']" src="/assets/img/icon-required-yes.svg">
+ <img *ngIf="!dict['input-param']" src="/assets/img/icon-required-no.svg">
</td>
<td>{{ dict['name'] }}</td>
<td>{{ dict['name'] }}</td>
<!-- {{ dict.definition.sources }} -->
</td>
<td>{{ dict['property']['default'] }}</td>
+ <td *ngIf="dict?.property?.metadata">
+ {{dict?.property?.metadata['transform-template']}}
+ </td>
+ <td *ngIf="!dict?.property?.metadata"></td>
<td>{{ dict['property']['type'] }}</td>
<td>{{ dict['property']['entry_schema'] }}</td>
</tr>
import { JsonConvert, Any } from 'json2typescript';
import { ToastrService } from 'ngx-toastr';
import { SharedService } from '../shared-service';
-import { XmlParser } from '../utils/XmlParser';
+import { XmlParser } from '../utils/ParserFactory/XmlParser';
import { TourService } from 'ngx-tour-md-menu';
+import { PackageCreationService } from '../../package-creation.service';
+import { ParserFactory } from '../utils/ParserFactory/ParserFactory';
+import { TemplateType, FileExtension } from '../utils/TemplateType';
declare var $: any;
@Component({
MappingAdapter: MappingAdapter;
mapping = new Map();
templateFileContent: string;
- templateExt = 'Velcoity';
+ templateExt = 'vtl';
dependancies = new Map<string, Array<string>>();
dependanciesSource = new Map<string, string>();
mappingRes = [];
currentTemplate: any;
currentMapping: any;
edit = false;
+ templatesExist = false;
fileToDelete: any = {};
+ parserFactory: ParserFactory;
+ selectedProps: Set<string>;
constructor(
private packageCreationStore: PackageCreationStore,
private packageCreationUtils: PackageCreationUtils,
private toastr: ToastrService,
private sharedService: SharedService,
+ private packageCreationService: PackageCreationService,
private tourService: TourService,
) {
}
ngOnInit() {
+ this.selectedProps = new Set<string>();
+ this.parserFactory = new ParserFactory();
this.templateStore.state$.subscribe(templateInfo => {
// init Template&mapping vars
console.log('Oninit');
this.fileToDelete = templateInfo.fileName;
this.fileName = templateInfo.fileName.split('/')[1];
if (this.fileName) {
- this.fileName = this.fileName.split('-')[0];
+ this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('-'));
}
if (templateInfo.type === 'mapping' || templateInfo.type.includes('mapping')) {
this.mappingRes = templateInfo.mapping;
} else {
this.mappingRes = [];
this.currentMapping = Any;
+ this.resourceDictionaryRes = [];
}
this.templateFileContent = templateInfo.fileContent;
+ this.templateExt = this.templateInfo.ext || this.templateExt;
this.currentTemplate = Object.assign({}, templateInfo);
if (templateInfo.type === 'template' || templateInfo.type.includes('template')) {
- this.currentTemplate.fileName = 'Templates/' + this.fileName + '-template.vtl';
+ console.log('template extension ' + this.templateExt);
+ this.currentTemplate.fileName = 'Templates/' + this.fileName + '-template.' + this.templateExt;
+ console.log(this.currentTemplate.fileName);
} else {
this.currentTemplate = Any;
}
});
+
this.sharedService.isEdit().subscribe(res => {
- console.log('------------------------');
+ console.log('------------------------....');
+ this.templatesExist = this.packageCreationStore.state.templates.files.size > 0
+ || this.packageCreationStore.state.mapping.files.size > 0;
console.log(res);
this.edit = res;
pageLength: 25,
destroy: true,
retrieve: true,
+ columnDefs: [
+ {
+ targets: [0, 1, 2], // column or columns numbers
+ orderable: false, // set orderable for selected columns
+ searchable: false,
+ },
+
+ ],
};
this.dtOptions = {
pagingType: 'full_numbers',
};
}
+ setProp(e, propName, index) {
+ this.resourceDictionaryRes[index][propName] = e.checked;
+ console.log(this.resourceDictionaryRes[index]);
+ }
+ selectProp(value) {
+ console.log(value);
+ if (this.selectedProps.has(value)) {
+ this.selectedProps.delete(value);
+ } else {
+ this.selectedProps.add(value);
+ }
+ }
+
+ removeProps() {
+ console.log(this.selectedProps);
+ this.selectedProps.forEach(prop => {
+ this.resourceDictionaryRes.forEach((res, index) => {
+ if (res.name === prop) {
+ console.log('delete...');
+ this.resourceDictionaryRes.splice(index, 1);
+ this.selectedProps.delete(prop);
+ }
+ });
+ });
+ }
+ selectAllProps() {
+ if (this.resourceDictionaryRes.length === this.selectedProps.size) {
+ this.selectedProps = new Set<string>();
+ } else {
+ this.resourceDictionaryRes.forEach(prop => {
+ console.log(prop);
+ this.selectedProps.add(prop.name);
+ });
+ }
+
+ }
+ reMap() {
+ let currentResDictionary = [];
+ if (this.selectedProps && this.selectedProps.size > 0) {
+ console.log('base');
+ this.packageCreationService.getTemplateAndMapping([...this.selectedProps]).subscribe(res => {
+ let message = 'Re-Auto mapping';
+ this.mappingRes = [];
+ currentResDictionary = res;
+ console.log(currentResDictionary);
+ if (currentResDictionary && currentResDictionary.length <= 0) {
+ message = 'No values for those attributes';
+ }
+
+ // Replcae new values with the old ones
+ currentResDictionary.forEach(curr => {
+ for (let i = 0; i < this.resourceDictionaryRes.length; i++) {
+ if (this.resourceDictionaryRes[i].name === curr.name) {
+ this.resourceDictionaryRes[i] = curr;
+ }
+ }
+ });
+ this.rerender();
+ this.toastr.success(message, 'Success');
+ }, err => {
+ this.toastr.error('Error');
+ });
+ }
+
+ }
+
getFileExtension() {
switch (this.templateExt) {
- case 'Velcoity':
+ case 'vtl':
return '.vtl';
- case 'Koltin':
+ case 'kt':
return '.ktl';
- case 'Jinja':
+ case 'j2':
return '.j2';
default:
return '.vtl';
}
public getTemplateVariable(fileContent: string) {
- const variables: string[] = [];
- const stringsSlittedByBraces = fileContent.split('${');
- const stringsDefaultByDollarSignOnly = fileContent.split('"$');
-
- for (let i = 1; i < stringsSlittedByBraces.length; i++) {
- const element = stringsSlittedByBraces[i];
- if (element) {
- const firstElement = element.split('}')[0];
- if (!variables.includes(firstElement)) {
- variables.push(firstElement);
- } else {
- console.log(firstElement);
- }
- }
- }
-
- for (let i = 1; i < stringsDefaultByDollarSignOnly.length; i++) {
- const element = stringsDefaultByDollarSignOnly[i];
- if (element && !element.includes('$')) {
- const firstElement = element.split('"')[0]
- .replace('{', '')
- .replace('}', '').trim();
- if (!variables.includes(firstElement)) {
- variables.push(firstElement);
- }
- }
- }
- return variables;
+ // TODO: implement factory Pattern for parser
+ console.log('start parsing........ ' + this.templateExt);
+ const parser = this.parserFactory.getParser(fileContent, this.templateExt);
+ return parser.getVariables(fileContent);
}
public dropped(files: NgxFileDropEntry[]) {
const parser = new XmlParser();
this.variables = parser.getVariables(fileReader.result.toString());
}
- console.log(this.variables);
+ console.log('variables = ' + this.variables);
this.getMappingTableFromTemplate(null);
};
const fileReader = new FileReader();
fileReader.onload = (e) => {
this.templateFileContent = fileReader.result.toString();
- this.variables = this.getTemplateVariable(this.templateFileContent);
+ // this.variables = this.getTemplateVariable(this.templateFileContent);
+ // console.log(this.variables);
};
fileReader.readAsText(file);
this.showCreationView.emit('close create form and open list');
}
+ identify(index, item) {
+ return item.name;
+ }
+ setVelocity(index, value) {
+ // console.log('velocity value = ' + value);
+ // console.log(this.resourceDictionaryRes[index]);
+ // tslint:disable-next-line: no-string-literal
+ this.resourceDictionaryRes[index].definition.property['metadata'] = {
+ 'transform-template': value
+ };
+ console.log(this.resourceDictionaryRes[index]);
+ }
+
getMappingTableFromTemplate(e) {
console.log('-' + this.templateFileContent + '-');
this.resourceDictionaryRes = [];
if (e) {
e.preventDefault();
}
+ this.variables = this.getTemplateVariable(this.templateFileContent);
+ console.log('variables = ' + this.variables);
if (this.variables && this.variables.length > 0) {
console.log('base');
- this.packageCreationStore.getTemplateAndMapping(this.variables).subscribe(res => {
+ this.packageCreationService.getTemplateAndMapping(this.variables).subscribe(res => {
let message = 'Attributes are Fetched';
this.mappingRes = [];
this.resourceDictionaryRes = res;
}, err => {
this.toastr.error('Error');
});
+ } else {
+ this.toastr.error('Empty or Invalid file format. Validate your file first');
}
}
}
return map.key;
}
- cancel() {
+ clear() {
this.fileName = '';
this.templateFileContent = '';
this.resourceDictionaryRes = [];
this.currentTemplate = {};
// this.closeCreationForm();
}
+ cancel() {
+ this.openListView();
+ }
saveToStore() {
if (this.fileName) {
// check file duplication
this.fileName = '';
this.toastr.success('File is created', 'success');
this.openListView();
- console.log(this.tourService.getStatus());
- this.tourService.goto('tm-templateEdit');
+ if (localStorage.getItem('tour-guide') !== 'end' && localStorage.getItem('tour-guide') !== 'false') {
+ this.tourService.goto('tm-templateEdit');
+ }
} else {
console.log('this file already exist');
this.toastr.error('File name already exist', 'Error');
rerender(): void {
this.dtTrigger.next();
-
- // if (this.dtElement.dtInstance) {
- // console.log('rerender');
- // this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
- // dtInstance.destroy();
- // this.dtElement.dtOptions = this.dtOptions;
- // this.dtElement.dtTrigger.next();
- // dtInstance.draw();
- // });
- // } else {
- // this.dtTrigger.next();
- // }
}
ngOnDestroy(): void {
// Do not forget to unsubscribe the event
this.dtTrigger.unsubscribe();
this.resTableDtTrigger.unsubscribe();
+ // this.templateStore.unsubscribe();
}
}
-import { Component, EventEmitter, OnInit, Output } from '@angular/core';
+import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
import { PackageCreationStore } from '../../package-creation.store';
import { Mapping, Template } from '../../mapping-models/CBAPacakge.model';
import { TemplateInfo, TemplateStore } from '../../template.store';
import { ActivatedRoute } from '@angular/router';
import { SharedService } from '../shared-service';
import { TourService } from 'ngx-tour-md-menu';
+import { TemplateType } from '../utils/TemplateType';
@Component({
templateUrl: './templ-mapp-listing.component.html',
styleUrls: ['./templ-mapp-listing.component.css']
})
-export class TemplMappListingComponent implements OnInit {
+export class TemplMappListingComponent implements OnInit, OnDestroy {
@Output() showCreationView = new EventEmitter<any>();
@Output() showListView = new EventEmitter<any>();
templateAndMappingMap = new Map<string, TemplateAndMapping>();
isCreate = true;
currentFile: string;
edit = false;
- fileToDelete: any = {};
+ fileToDelete = '';
constructor(
private packageCreationStore: PackageCreationStore,
private route: ActivatedRoute,
private sharedService: SharedService,
private tourService: TourService,
-
) {
}
+ ngOnDestroy(): void {
+ // this.templateStore.unsubscribe();
+ // this.packageCreationStore.unsubscribe();
+ }
+
ngOnInit() {
+ this.templateAndMappingMap = new Map<string, TemplateAndMapping>();
+ this.edit = false;
if (this.route.snapshot.paramMap.has('id')) {
this.isCreate = false;
this.sharedService.isEdit().subscribe(res => {
}
private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) {
- const nameOfFile = key.split('/')[1].split('.')[0].split('-')[0];
+ const nameOfFile = isFromTemplate ?
+ key.split('/')[1].split('.')[0].split('-template')[0]
+ : key.split('/')[1].split('.')[0].split('-mapping')[0];
// const fullName = nameOfFile + ',' + key.split('.');
if (this.templateAndMappingMap.has(nameOfFile)) {
const templateAndMappingExisted = this.templateAndMappingMap.get(nameOfFile);
createNewTemplate() {
this.openCreationView();
this.sharedService.disableEdit();
- this.tourService.goto('tm-templateName');
+ if (localStorage.getItem('tour-guide') !== 'end' && localStorage.getItem('tour-guide') !== 'false') {
+ this.tourService.goto('tm-templateName');
+ }
}
+
openCreationView() {
this.showCreationView.emit('tell parent to open create views');
console.log('disable edit mode');
}
+
openListView() {
console.log('open list view');
this.showListView.emit('show full view');
setSourceCodeEditor(key: string) {
this.currentFile = key;
- const templateKey = 'Templates/' + key + '-template.vtl';
+ const templateKey = 'Templates/' + key + '-template';
this.packageCreationStore.state$.subscribe(cba => {
console.log('cba ------');
console.log(cba);
console.log(key);
console.log(this.templateAndMappingMap);
const templateInfo = new TemplateInfo();
- if (cba.templates && cba.templates.files.has(templateKey)) {
- const fileContent = cba.templates.getValue(templateKey.trim());
- console.log(fileContent);
- templateInfo.fileContent = fileContent;
- templateInfo.fileName = templateKey;
- templateInfo.type = 'template';
+ // tslint:disable-next-line: forin
+ for (const templateType in TemplateType) {
+ const fileName = templateKey + '.' + TemplateType[templateType];
+ if (cba.templates && cba.templates.files.has(fileName)) {
+ const fileContent = cba.templates.getValue(fileName.trim());
+ console.log(templateType + '......ccccccc.... ' + fileName);
+ templateInfo.fileContent = fileContent;
+ templateInfo.fileName = fileName;
+ templateInfo.ext = TemplateType[templateType];
+ templateInfo.type = 'template';
+ break;
+ }
}
const mappingKey = 'Templates/' + key + '-mapping.json';
if (cba.mapping && cba.mapping.files.has(mappingKey)) {
}
this.templateStore.changeTemplateInfo(templateInfo);
this.openCreationView();
- this.sharedService.enableEdit();
+ if (templateInfo.fileName && templateInfo.fileName.length > 0) {
+ this.sharedService.enableEdit();
+ }
});
}
getValue(file: string) {
return this.templateAndMappingMap.get(file);
}
+
initDelete(file) {
console.log(file);
- this.fileToDelete = file;
+ const templateKey = 'Templates/' + file + '-template';
+ // tslint:disable-next-line: forin
+ for (const templateType in TemplateType) {
+ const fileName = templateKey + '.' + TemplateType[templateType];
+ if (this.packageCreationStore.state.templates.files.has(fileName)) {
+ this.fileToDelete = fileName;
+ break;
+ }
+ }
+
}
+
condifrmDelete() {
- console.log(this.templateAndMappingMap);
- this.templateAndMappingMap.delete(this.fileToDelete);
+ const fullName = this.fileToDelete.split('/')[1];
+ const file = fullName.substr(0, fullName.lastIndexOf('-'));
+ const ext = fullName.substr(fullName.lastIndexOf('.') + 1);
+ this.templateAndMappingMap.delete(file);
if (this.templateAndMappingMap.size <= 0) {
this.openCreationView();
}
// Delete from templates
- this.packageCreationStore.state.templates.files.delete('Templates/' + this.fileToDelete + '-template.vtl');
+ this.packageCreationStore.state.templates.files.delete('Templates/' + file + '-template.' + ext);
// Delete from Mapping
- this.packageCreationStore.state.mapping.files.delete('Templates/' + this.fileToDelete + '-mapping.json');
+ this.packageCreationStore.state.mapping.files.delete('Templates/' + file + '-mapping.json');
+ console.log(this.templateAndMappingMap);
}
-import { Component, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { PackageCreationStore } from '../package-creation.store';
import { SharedService } from './shared-service';
templateUrl: './template-mapping.component.html',
styleUrls: ['./template-mapping.component.css']
})
-export class TemplateMappingComponent implements OnInit {
+export class TemplateMappingComponent implements OnInit, OnDestroy {
creationView = false;
listView = true;
private sharedService: SharedService
) {
}
+ ngOnDestroy(): void {
+ // this.sharedService.list.unsubscribe();
+ // this.sharedService.mode.unsubscribe();
+ // this.pakcageStore.unsubscribe();
+ }
ngOnInit() {
+++ /dev/null
-import { XmlParser } from './XmlParser';
-
-fdescribe('ImportsTabComponent', () => {
- const parser: XmlParser = new XmlParser();
-
-
- beforeEach(() => {
- });
-
- it('Test xml Parser', () => {
- const fileContent = `<vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
- <vdns-instances>
- <vdns-instance>
- <ip-addr>$vdns_int_private_ip_0</ip-addr>
- <oam-ip-addr>$vdns_onap_private_ip_0</oam-ip-addr>
- <enabled>false</enabled>
- <tag>dddd</tag>
- </vdns-instance>
- </vdns-instances>
- </vlb-business-vnf-onap-plugin>`;
-
- const res = parser.getVariables(fileContent);
- console.log(res);
- expect(res.length).toEqual(2);
- expect(res[0]).toEqual('vdns_int_private_ip_0');
- expect(res[1]).toEqual('vdns_onap_private_ip_0');
- });
-});
--- /dev/null
+import { Parser } from './Parser';
+
+export class ASCIIParser implements Parser {
+ variables: Set<string> = new Set();
+ getVariables(fileContent: string): string[] {
+ if (fileContent.includes('$(')) {
+ const xmlSplit = fileContent.split('$(');
+ for (const val of xmlSplit) {
+ const res = val.substring(0, val.indexOf(')'));
+ if (res && res.length > 0) {
+ this.variables.add(res);
+ }
+
+ }
+ }
+ return [...this.variables];
+ }
+
+}
--- /dev/null
+import { Parser } from './Parser';
+
+export class JinjaXMLParser implements Parser {
+ variables: Set<string> = new Set();
+ getVariables(fileContent: string): string[] {
+ if (fileContent.includes('>[')) {
+ const xmlSplit = fileContent.split('>[');
+ for (const val of xmlSplit) {
+ const res = val.substring(0, val.indexOf(']</'));
+ if (res && res.length > 0) {
+ this.variables.add(res);
+ }
+
+ }
+ }
+ return [...this.variables];
+ }
+
+}
+
+/*
+
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos">
+<system xmlns="http://yang.juniper.net/junos-qfx/conf/system">
+<host-name operation="delete" />
+<host-name operation="create">[hostname]</host-name>
+</system>
+</configuration>
+
+*/
--- /dev/null
+import { Parser } from './Parser';
+
+export class JinjaYMLParser implements Parser {
+ variables: Set<string> = new Set();
+ getVariables(fileContent: string): string[] {
+ if (fileContent.includes('{{')) {
+ // '[{]+[ ]*.[V-v]alues.' old regex
+ const xmlSplit = fileContent.split(new RegExp('[{]+[ ]*.'));
+ for (const val of xmlSplit) {
+ const res = val.substring(0, val.indexOf('}}'));
+ if (res && res.length > 0) {
+ console.log(res);
+ if (res.includes('Value')) {
+ this.variables.add(this.extractValues(res.trim()));
+ } else {
+ this.variables.add(this.extractParent(res.trim()).toLowerCase());
+ }
+ }
+ }
+ }
+ return [...this.variables];
+ }
+
+ extractValues(value) {
+ return value.split('Values.')[1];
+ }
+ extractParent(value): string {
+ return value.split('.')[0];
+ }
+
+}
+
+/*
+vf-module-name: {{ .Values.vpg_name_0 }}
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos">
+<system xmlns="http://yang.juniper.net/junos-qfx/conf/system">
+<host-name operation="delete" />
+<host-name operation="create">[hostname]</host-name>
+</system>
+</configuration>
+
+*/
--- /dev/null
+import { XmlParser } from './XmlParser';
+import { ParserFactory } from './ParserFactory';
+import { FileExtension } from '../TemplateType';
+import { JinjaXMLParser } from './JinjaXML';
+
+fdescribe('ImportsTabComponent', () => {
+
+ const parserFactory = new ParserFactory();
+
+
+ beforeEach(() => {
+ });
+
+ it('Test xml Parser', () => {
+ const fileContent = `<vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
+ <vdns-instances>
+ <vdns-instance>
+ <ip-addr>$vdns_int_private_ip_0</ip-addr>
+ <oam-ip-addr>$vdns_onap_private_ip_0</oam-ip-addr>
+ <enabled>false</enabled>
+ <tag>dddd</tag>
+ </vdns-instance>
+ </vdns-instances>
+ </vlb-business-vnf-onap-plugin>`;
+
+ const parser = parserFactory.getParser(fileContent, FileExtension.XML);
+ const res = parser.getVariables(fileContent);
+ console.log(res);
+ expect(res.length).toEqual(2);
+ expect(res[0]).toEqual('vdns_int_private_ip_0');
+ expect(res[1]).toEqual('vdns_onap_private_ip_0');
+ });
+
+ it('Test J2 XML Parser', () => {
+ const fileContent = `<?xml version="1.0" encoding="UTF-8"?>
+ <configuration xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos">
+ <system xmlns="http://yang.juniper.net/junos-qfx/conf/system">
+ <host-name operation="delete" />
+ <host-name operation="create">[hostname]</host-name>
+ </system>
+ </configuration>`;
+
+ const parser = parserFactory.getParser(fileContent, FileExtension.Jinja);
+ const res = parser.getVariables(fileContent);
+ console.log(typeof (res));
+ console.log(res);
+ expect(res.length).toEqual(1);
+ expect(res[0]).toEqual('hostname');
+
+ });
+
+ it('Test J2 YML Parser', () => {
+ const fileContent = `apiVersion: v1
+ kind: Service
+ metadata:
+ name: {{ .Values.vpg_name_0 }}-ssh
+ labels:
+ vnf-name: {{ .Values.vnf_name }}
+ vf-module-name: {{ .Values.vpg_name_0 }}
+ release: {{ .Release.Name }}
+ chart: {{ .Chart.Name }}
+ spec:
+ type: NodePort
+ ports:
+ port: 22
+ nodePort: \${vpg-management-port}
+ selector:
+ vf-module-name: {{ .Values.vpg_name_0 }}
+ release: {{ .Release.Name }}
+ chart: {{ .Chart.Name }}`;
+
+ const parser = parserFactory.getParser(fileContent, FileExtension.Jinja);
+ const res = parser.getVariables(fileContent);
+ console.log(res);
+ expect(res.length).toEqual(4);
+ expect(res[0]).toEqual('vpg_name_0');
+ expect(res[1]).toEqual('vnf_name');
+
+ });
+
+ it('Test ASCII Parser', () => {
+ const fileContent = `
+ config system interface
+ edit "internal"
+ set vdom "root"
+ set ip $(subnet1_fgt_ip) 255.255.255.0 #1
+ set allowaccess ping https ssh http fgfm capwap
+ set type hard-switch
+ set stp enable
+ set role lan
+ next
+ end
+ config system dhcp server
+ edit 1
+ set dns-service default
+ set default-gateway $(subnet1_fgt_ip) #2
+ set netmask 255.255.255.0
+ set interface "internal"
+ config ip-range
+ edit 1
+ set start-ip $(subnet1_fgt_ip)4,150 #3
+ set end-ip $(subnet1_fgt_ip)4,200 #4
+ next
+ end
+ next
+ end
+ Options
+ `;
+
+ const parser = parserFactory.getParser(fileContent, FileExtension.Jinja);
+ const res = parser.getVariables(fileContent);
+ console.log(res);
+ expect(res.length).toEqual(1);
+ expect(res[0]).toEqual('subnet1_fgt_ip');
+
+
+ });
+
+
+
+
+
+ it('Test Velocity YML Parser', () => {
+ const fileContent = `apiVersion: v1
+ kind: Service
+ metadata:
+ name: {{ .Values.vpg_name_0 }}-ssh
+ labels:
+ vnf-name: {{ .Values.vnf_name }}
+ vf-module-name: {{ .Values.vpg_name_0 }}
+ release: {{ .Release.Name }}
+ chart: {{ .Chart.Name }}
+ spec:
+ type: NodePort
+ ports:
+ port: 22
+ nodePort: \${vpg-management-port}
+ selector:
+ vf-module-name: {{ .Values.vpg_name_0 }}
+ release: {{ .Release.Name }}
+ chart: {{ .Chart.Name }}`;
+
+ const parser = parserFactory.getParser(fileContent, FileExtension.Velocity);
+ const res = parser.getVariables(fileContent);
+ console.log(res);
+ expect(res.length).toEqual(1);
+ expect(res[0]).toEqual('vpg-management-port');
+
+ });
+
+
+
+});
export interface Parser {
+ variables: Set<string>;
getVariables(fileContent: string): string[];
}
--- /dev/null
+
+import { XmlParser } from './XmlParser';
+import { Parser } from './Parser';
+import { VtlParser } from './VtlParser';
+import { FileExtension } from '../TemplateType';
+import { JinjaXMLParser } from './JinjaXML';
+import { VtlYMLParser } from './VtlYMLParser';
+import { JinjaYMLParser } from './JinjaYML';
+import { ASCIIParser } from './ASCII-Parser';
+
+export class ParserFactory {
+
+ getParser(fileContent: string, fileExtension: string): Parser {
+ let parser: Parser;
+ console.log('file extension =' + fileExtension);
+
+ if (fileExtension === FileExtension.Velocity) {
+
+ if (this.isXML(fileContent)) {
+ parser = new XmlParser();
+ } else if (this.isJSON(fileContent)) {
+ parser = new VtlParser();
+ } else if (this.isASCII(fileContent)) {
+ parser = new ASCIIParser();
+ } else {
+ console.log('Velocity YML parser....');
+ parser = new VtlYMLParser();
+ }
+
+ } else if (fileExtension === FileExtension.Jinja) {
+
+ if (this.isXML(fileContent)) {
+ parser = new JinjaXMLParser();
+ } else if (this.isJSON(fileContent)) {
+ // TODO: implement JSON parser
+ } else if (this.isASCII(fileContent)) {
+ parser = new ASCIIParser();
+ } else {
+ console.log('Jinja YML parser....');
+ parser = new JinjaYMLParser();
+ }
+
+ } else if (fileExtension === FileExtension.XML) {
+ parser = new XmlParser();
+ }
+ return parser;
+ }
+
+ private isXML(fileContent: string): boolean {
+ return fileContent.includes('<?xml version="1.0" encoding="UTF-8"?>');
+ }
+
+ private isJSON(fileContent: string): boolean {
+ try {
+ JSON.parse(fileContent);
+ } catch (e) {
+ return false;
+ }
+ return true;
+ }
+
+ private isASCII(fileContent: string): boolean {
+ if (
+ fileContent.includes('end') &&
+ fileContent.includes('set') &&
+ fileContent.includes('$(')
+ ) {
+ return true;
+ }
+
+ return false;
+ }
+}
--- /dev/null
+import { Parser } from './Parser';
+
+export class VtlParser implements Parser {
+ variables: Set<string> = new Set();
+ getVariables(fileContent: string): string[] {
+ const variables: string[] = [];
+ const stringsSlittedByBraces = fileContent.split('${');
+ const stringsDefaultByDollarSignOnly = fileContent.split('"$');
+
+ for (let i = 1; i < stringsSlittedByBraces.length; i++) {
+ const element = stringsSlittedByBraces[i];
+ if (element) {
+ const firstElement = element.split('}')[0];
+ if (!variables.includes(firstElement)) {
+ variables.push(firstElement);
+ } else {
+ console.log(firstElement);
+ }
+ }
+ }
+
+ for (let i = 1; i < stringsDefaultByDollarSignOnly.length; i++) {
+ const element = stringsDefaultByDollarSignOnly[i];
+ if (element && !element.includes('$')) {
+ const firstElement = element.split('"')[0]
+ .replace('{', '')
+ .replace('}', '').trim();
+ if (!variables.includes(firstElement)) {
+ variables.push(firstElement);
+ }
+ }
+ }
+ this.variables = new Set(variables);
+ return [...variables];
+ }
+
+}
+
+/*
+
+<vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
+ <vdns-instances>
+ <vdns-instance>
+ <ip-addr>$vdns_int_private_ip_0</ip-addr>
+ <oam-ip-addr>$vdns_onap_private_ip_0</oam-ip-addr>
+ <tag>aaaa</tag>
+ <enabled>false</enabled>
+ <tag>dddd</tag>
+ </vdns-instance>
+ </vdns-instances>
+</vlb-business-vnf-onap-plugin>
+
+*/
--- /dev/null
+import { Parser } from './Parser';
+
+export class VtlYMLParser implements Parser {
+ variables: Set<string> = new Set();
+ getVariables(fileContent: string): string[] {
+ if (fileContent.includes('${')) {
+ const xmlSplit = fileContent.split('${');
+ for (const val of xmlSplit) {
+ const res = val.substring(0, val.indexOf('}'));
+ if (res && res.length > 0 && !res.includes('{')) {
+ this.variables.add(res);
+ }
+
+ }
+ }
+ return [...this.variables];
+ }
+
+}
+
+/*
+
+<vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
+ <vdns-instances>
+ <vdns-instance>
+ <ip-addr>$vdns_int_private_ip_0</ip-addr>
+ <oam-ip-addr>$vdns_onap_private_ip_0</oam-ip-addr>
+ <tag>aaaa</tag>
+ <enabled>false</enabled>
+ <tag>dddd</tag>
+ </vdns-instance>
+ </vdns-instances>
+</vlb-business-vnf-onap-plugin>
+
+*/
import { Parser } from './Parser';
-import { variable } from '@angular/compiler/src/output/output_ast';
export class XmlParser implements Parser {
+ variables: Set<string> = new Set();
getVariables(fileContent: string): string[] {
- const variables = [];
const xmlSplit = fileContent.split('$');
for (const val of xmlSplit) {
const res = val.substring(0, val.indexOf('</'));
if (res && res.length > 0) {
- variables.push(res);
+ this.variables.add(res);
}
}
- return variables;
+ return [...this.variables];
}
}
--- /dev/null
+export enum TemplateType {
+ Velocity = 'vtl',
+ Koltin = 'kt',
+ Jinja = 'j2',
+}
+
+export enum FileExtension {
+ Velocity = 'vtl',
+ Koltin = 'kt',
+ Jinja = 'j2',
+ CSV = 'csv',
+ XML = 'xml'
+}
fileName: string;
fileContent: string;
type: string;
+ ext: string;
mapping = [];
this.fileName = '';
this.fileContent = '';
this.type = '';
+ this.ext = '';
}
this.checkBoxTages = '';
this.checkboxes.forEach((element) => {
element.nativeElement.checked = false;
+ this.packagesStore.getAll();
});
}
}
},
{
anchorId: 'metadataTab',
- content: 'Set your package basic information',
+ content: 'It captures the model entities that compose the cba package name, version, description and searchable tags.',
title: 'Metadata Tab',
route: 'packages/createPackage'
},
{
anchorId: 'mt-packageName',
- content: 'Set your package name (required)',
+ content: 'Set your package name (required).',
title: 'Package name',
},
{
anchorId: 'mt-packageVersion',
- content: 'Set your package version like 1.0.0 (required)',
+ content: 'Set your package version like 1.0.0 (required).',
title: 'Package version',
},
{
anchorId: 'mt-packageDescription',
- content: 'Set your package description (required)',
+ content: 'Set your package description (required).',
title: 'Package description',
},
{
anchorId: 'mt-packageTags',
- content: 'Set your package Tags (Optional)',
+ content: 'Set your package Tags (Optional).',
title: 'Package tag',
},
// {
// Temaplate & Mapping
{
anchorId: 'tm-templateTab',
- content: 'Create Your \'Template & Mapping \' files',
+ content: 'A template is an artifact, and uses Modeling Concepts#artifact-mapping-resource and artifact-template-velocity. ',
title: 'Temaplate & Mapping',
stepId: 'tm-templateTab'
},
{
anchorId: 'tm-templateName',
- content: 'Set your Template & Mapping Name',
+ content: 'Set your Template & Mapping Name.',
title: 'Temaplte & Mapping name',
stepId: 'tm-templateName'
},
{
anchorId: 'tm-templateType',
- content: 'Set your Template Type',
+ content: 'Set your Template Type.',
title: 'Temaplte Type',
},
{
anchorId: 'tm-templateContent',
- content: 'Click \'Import File\' to get content from a file, or write template content manually',
+ content: 'Click \'Import File\' to get content from a file, or write template content manually.',
title: 'Template Content',
},
{
anchorId: 'tm-mappingContent',
- content: 'Set your mapping content from the current template, or from an external file (XML, CSV)',
+ content: 'Set your mapping content from the current template, or from an external file (XML, CSV).',
title: 'Mapping Content',
},
{
anchorId: 'tm-templateFinish',
- content: 'Click your \' Finish \' button when you finish ',
+ content: 'Click your \'Finish\' button to save your template.',
title: 'Finish',
stepId: 'tm-templateFinish'
},
- {
- anchorId: 'tm-templateEdit',
- content: 'Create another new Template or Click on the previous one to edit',
- title: 'Create & Edit',
- stepId: 'tm-templateEdit'
- },
+ // {
+ // anchorId: 'tm-templateEdit',
+ // content: 'Create another new Template or Click on the previous one to edit.',
+ // title: 'Create & Edit',
+ // stepId: 'tm-templateEdit'
+ // },
// Script
{
anchorId: 'st-scriptsTab',
- content: 'Move To Scripts Tab to set your Kotlin and Python scripts',
+ content: 'It is Kotlin/Python scripts that allows the execution of a sequence of instructions as part of CDS workflow execution.',
title: 'Scripts',
stepId: 'st-scriptsTab'
},
{
anchorId: 'st-scriptsImport',
- content: 'Click \' Import File\'button kotlin and python files',
+ content: 'Click to import kotlin or python files.',
title: 'Import File'
},
// DSL
{
anchorId: 'dslTab',
- content: 'Write your Authentication Properties in Javascript',
- title: 'ESAP',
+ content: 'Interaction with external systems is made dynamic, removing development cycle to support new endpoint.',
+ title: 'External Systems support',
stepId: 'dslTab'
},
// save package
{
anchorId: 'packageSave',
- content: 'Click \' Save \' button to create your package',
+ content: 'Click to save your package.',
title: 'Save'
}
];
--- /dev/null
+<div class="modal fade" id="importPackageModal" tabindex="-1" role="dialog" aria-labelledby="importPackageModal"
+ aria-hidden="true">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="importModalLabel">Import File</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <!-- <span aria-hidden="true">×</span> -->
+ <img src="assets/img/icon-close.svg"/>
+ </button>
+ </div>
+ <div class="modal-body">
+ <ngx-file-drop accept=".zip" dropZoneLabel="Drop files here" (onFileDrop)="dropped($event)"
+ (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)">
+ <ng-template ngx-file-drop-content-tmp let-openFileSelector="openFileSelector">
+ <div class="folder-upload">
+ <img src="assets/img/folder-upload.svg"/>
+ </div>
+ <div class="folder-upload-text">
+ Drag & Drop file
+ </div>
+ <div class="folder-upload-text">or
+ <button type="button" class="btn btn-sm btn-primary" (click)="openFileSelector()">Browse
+ Files
+ </button>
+ </div>
+ <div class="folder-upload-type">Allowed file type: zip</div>
+ </ng-template>
+ </ngx-file-drop>
+ <div class="upload-table">
+ <table class="table">
+ <thead>
+ <tr *ngFor="let item of uploadedFiles; let i=index">
+ <th width="40"><img src="assets/img/icon-file-code.svg"/></th>
+ <th>{{ item.name }}</th>
+ <th (click)="removeInitFile(i)" width="40" class="text-right"><img
+ src="assets/img/icon-remove-file.svg"/></th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal"
+ (click)="resetTheUploadedFiles()">Cancel
+ </button>
+ <button type="button" class="btn btn-sm btn-primary" [disabled]="uploadedFiles?.length<=0"
+ data-dismiss="modal" (click)="importAndSave()">
+ Import&Save
+ </button>
+ <button type="button" class="btn btn-sm btn-primary" [disabled]="uploadedFiles?.length<=0"
+ data-dismiss="modal" (click)="importPackageAndViewIt()">
+ Import
+ </button>
+
+ </div>
+ </div>
+ </div>
+</div>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ImportPackageComponent } from './import-package.component';
+
+describe('ImportPackageComponent', () => {
+ let component: ImportPackageComponent;
+ let fixture: ComponentFixture<ImportPackageComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ImportPackageComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ImportPackageComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import {Component, OnInit} from '@angular/core';
+import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop';
+import {PackageCreationExtractionService} from '../../package-creation/package-creation-extraction.service';
+import {Router} from '@angular/router';
+import {PackageCreationStore} from '../../package-creation/package-creation.store';
+import * as JSZip from 'jszip';
+import {PackageCreationService} from '../../package-creation/package-creation.service';
+import {ToastrService} from 'ngx-toastr';
+import {PackagesStore} from '../../packages.store';
+
+@Component({
+ selector: 'app-import-package',
+ templateUrl: './import-package.component.html',
+ styleUrls: ['./import-package.component.css']
+})
+export class ImportPackageComponent implements OnInit {
+
+ public uploadedFiles: FileSystemFileEntry[] = [];
+ private fileNames: Set<string> = new Set();
+ fileToDelete: any = {};
+ zipFile: JSZip = new JSZip();
+ public files: NgxFileDropEntry[] = [];
+
+ constructor(private packageCreationExtractionService: PackageCreationExtractionService,
+ private packageCreationStore: PackageCreationStore,
+ private packageCreationService: PackageCreationService,
+ private toastService: ToastrService,
+ private packagesStore: PackagesStore,
+ private router: Router) {
+
+ }
+
+ ngOnInit() {
+
+ }
+
+ removeInitFile(index) {
+ this.uploadedFiles.splice(index, 1);
+ }
+
+ public dropped(files: NgxFileDropEntry[]) {
+ this.files = files;
+ for (const droppedFile of files) {
+ // Is it a file? & Not added before
+ if (droppedFile.fileEntry.isFile) {
+ const fileEntry = droppedFile.fileEntry as FileSystemFileEntry;
+ this.uploadedFiles.push(fileEntry);
+ console.log(fileEntry.name);
+ this.fileNames.add(fileEntry.name);
+
+ }
+ }
+ }
+
+ initDelete(file) {
+ console.log(file);
+ this.fileToDelete = file;
+ }
+
+ removeFile() {
+ const filename = this.fileToDelete.key;
+ for (let i = 0; i < this.uploadedFiles.length; i++) {
+ console.log(this.uploadedFiles[i]);
+ if (this.uploadedFiles[i].name === filename) {
+ this.uploadedFiles.splice(i, 1);
+ break;
+ }
+ }
+ }
+
+ resetTheUploadedFiles() {
+ this.uploadedFiles = [];
+ }
+
+
+ public fileOver(event) {
+ console.log(event);
+ }
+
+ public fileLeave(event) {
+ console.log(event);
+ }
+
+ importPackageAndViewIt() {
+ this.openFilesInCreationPackage();
+ this.saveFileToStore();
+ }
+
+ saveFileToStore() {
+ console.log(this.uploadedFiles.length);
+ const file = this.getFile(this.uploadedFiles[this.uploadedFiles.length - 1]);
+ this.packageCreationStore.clear();
+ this.packageCreationExtractionService.extractBlobToStore(file);
+ }
+
+ openFilesInCreationPackage() {
+ this.router.navigate(['/packages/createPackage/']);
+ }
+
+ async getFile(fileEntry) {
+ try {
+ return await new Promise((resolve, reject) => fileEntry.file(resolve, reject));
+ } catch (err) {
+ console.log(err);
+ }
+ }
+
+ importAndSave() {
+ const file = this.getFile(this.uploadedFiles[this.uploadedFiles.length - 1]);
+ this.zipFile = new JSZip();
+ this.zipFile.loadAsync(file).then(zip => {
+ this.zipFile = zip;
+ console.log(this.zipFile);
+ this.resetTheUploadedFiles();
+ this.zipFile.generateAsync({type: 'blob'}).then(blob => {
+ this.packageCreationService.savePackage(blob).subscribe(
+ bluePrintDetailModels => {
+ this.toastService.info('package is imported and saved successfully ');
+ this.router.navigate(['/packages']);
+ this.packagesStore.getAll();
+ }, error =>
+ this.toastService.error('there is an error happened ' + error));
+ });
+ });
+ }
+}
Package
</a>
<br />
- <a href="#" id="clone-btn" role="button" aria-pressed="true" class="btn-import-package float"><i
+ <a data-target="#importPackageModal" data-toggle="modal" id="clone-btn" role="button"
+ aria-pressed="true" class="btn-import-package float"><i
class="icon-import-blue" aria-hidden="true"></i>Import Package
</a>
<ngx-ui-loader></ngx-ui-loader>
</div>
</div>
</div>
+
+
+<app-import-package></app-import-package>
ngOnInit() {
this.packagesStore.getAll();
-
-
-
-
}
view(id) {
ngOnInit() {
console.log('PackagesDashboardComponent');
-
- this.tourService.initialize([...steps]);
this.checkTour();
}
}
start() {
+
+ this.tourService.initialize([...steps]);
console.log('start .................');
this.tourService.start();
+ localStorage.setItem('tour-guide', 'start');
this.tourService.events$.subscribe(res => {
console.log(res);
+
+ if (res.name === 'end') {
+ localStorage.setItem('tour-guide', 'end');
+ }
if (res.value && res.value.anchorId) {
if (res.value.anchorId.includes('mt-')) {
$('#nav-metadata-tab').trigger('click');
if (res.value.anchorId.includes('st-')) {
$('#nav-scripts-tab').trigger('click');
}
+
}
});
}
</label>
</p>
</li> -->
+ <li>
+ <i class="icon-get_started" aria-hidden="true"></i>
+ <p>
+ <input id="clicker3" type="checkbox" />
+ <label for="clicker">
+ Getting Started
+ <span>Quick steps to help you get started</span>
+ </label>
+ </p>
+ </li>
<li>
<a href="https://wiki.onap.org/display/DW/CDS+Designer+Guide" target="_blank">
<i class="icon-user_guide" aria-hidden="true"></i>
-import { NgModule } from '@angular/core';
-import { CommonModule, JsonPipe } from '@angular/common';
-import { ApiService } from '../../../common/core/services/api.typed.service';
-import { PackagesRoutingModule } from './packages.routing.module';
-import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
-import { SharedModulesModule } from '../../shared-modules/shared-modules.module';
-import { PackagesDashboardComponent } from './packages-dashboard/packages-dashboard.component';
-import { PackageListComponent } from './packages-dashboard/package-list/package-list.component';
-import { DesignerComponent } from './designer/designer.component';
-import { SidebarModule } from 'ng-sidebar';
-import { PackagePaginationComponent } from './packages-dashboard/package-pagination/package-pagination.component';
-import { SortPackagesComponent } from './packages-dashboard/sort-packages/sort-packages.component';
-import { PackagesHeaderComponent } from './packages-dashboard/packages-header/packages-header.component';
-import { PackagesSearchComponent } from './packages-dashboard/search-by-packages/search-by-packages.component';
-import { TagsFilteringComponent } from './packages-dashboard/filter-by-tags/filter-by-tags.component';
-import { ConfigurationDashboardComponent } from './configuration-dashboard/configuration-dashboard.component';
-import { ActionsComponent } from './designer/actions/actions.component';
-import { PackageCreationComponent } from './package-creation/package-creation.component';
-import { FormsModule } from '@angular/forms';
-import { ImportsTabComponent } from './package-creation/imports-tab/imports-tab.component';
-import { NgxFileDropModule } from 'ngx-file-drop';
-import { TemplateMappingComponent } from './package-creation/template-mapping/template-mapping.component';
-import { SourceEditorComponent } from './source-editor/source-editor.component';
-import { ScriptsTabComponent } from './package-creation/scripts-tab/scripts-tab.component';
-import { AceEditorModule } from 'ng2-ace-editor';
-import { MetadataTabComponent } from './package-creation/metadata-tab/metadata-tab.component';
-import { DslDefinitionsTabComponent } from './package-creation/dsl-definitions-tab/dsl-definitions-tab.component';
-import { TemplMappCreationComponent } from './package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component';
-import { TemplMappListingComponent } from './package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component';
-import { DataTablesModule } from 'angular-datatables';
-import { DesignerSourceViewComponent } from './designer/source-view/source-view.component';
-import { NgxUiLoaderModule } from 'ngx-ui-loader';
+import {NgModule} from '@angular/core';
+import {CommonModule, JsonPipe} from '@angular/common';
+import {ApiService} from '../../../common/core/services/api.typed.service';
+import {PackagesRoutingModule} from './packages.routing.module';
+import {NgbPaginationModule} from '@ng-bootstrap/ng-bootstrap';
+import {SharedModulesModule} from '../../shared-modules/shared-modules.module';
+import {PackagesDashboardComponent} from './packages-dashboard/packages-dashboard.component';
+import {PackageListComponent} from './packages-dashboard/package-list/package-list.component';
+import {DesignerComponent} from './designer/designer.component';
+import {SidebarModule} from 'ng-sidebar';
+import {PackagePaginationComponent} from './packages-dashboard/package-pagination/package-pagination.component';
+import {SortPackagesComponent} from './packages-dashboard/sort-packages/sort-packages.component';
+import {PackagesHeaderComponent} from './packages-dashboard/packages-header/packages-header.component';
+import {PackagesSearchComponent} from './packages-dashboard/search-by-packages/search-by-packages.component';
+import {TagsFilteringComponent} from './packages-dashboard/filter-by-tags/filter-by-tags.component';
+import {ConfigurationDashboardComponent} from './configuration-dashboard/configuration-dashboard.component';
+import {ActionsComponent} from './designer/actions/actions.component';
+import {PackageCreationComponent} from './package-creation/package-creation.component';
+import {FormsModule} from '@angular/forms';
+import {ImportsTabComponent} from './package-creation/imports-tab/imports-tab.component';
+import {NgxFileDropModule} from 'ngx-file-drop';
+import {TemplateMappingComponent} from './package-creation/template-mapping/template-mapping.component';
+import {SourceEditorComponent} from './source-editor/source-editor.component';
+import {ScriptsTabComponent} from './package-creation/scripts-tab/scripts-tab.component';
+import {AceEditorModule} from 'ng2-ace-editor';
+import {MetadataTabComponent} from './package-creation/metadata-tab/metadata-tab.component';
+import {DslDefinitionsTabComponent} from './package-creation/dsl-definitions-tab/dsl-definitions-tab.component';
+import {TemplMappCreationComponent} from './package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component';
+import {TemplMappListingComponent} from './package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component';
+import {DataTablesModule} from 'angular-datatables';
+import {DesignerSourceViewComponent} from './designer/source-view/source-view.component';
+import {NgxUiLoaderModule} from 'ngx-ui-loader';
import {TourMatMenuModule} from 'ngx-tour-md-menu';
+import {ComponentCanDeactivateGuard} from '../../../common/core/canDactivate/ComponentCanDeactivateGuard';
+import { ImportPackageComponent } from './packages-dashboard/import-package/import-package.component';
+import { FunctionsAttributeComponent } from './designer/functions-attribute/functions-attribute.component';
+import { ActionAttributesComponent } from './designer/action-attributes/action-attributes.component';
@NgModule({
declarations: [PackagesDashboardComponent,
MetadataTabComponent,
DslDefinitionsTabComponent,
DesignerSourceViewComponent,
+ ImportPackageComponent,
+ FunctionsAttributeComponent,
+ ActionAttributesComponent,
+
],
imports: [
CommonModule,
NgxUiLoaderModule,
TourMatMenuModule.forRoot()
],
- providers: [ApiService, JsonPipe],
+ providers: [ApiService, JsonPipe, ComponentCanDeactivateGuard],
bootstrap: []
})
export class PackagesModule {
import {NgModule} from '@angular/core';
-import {Routes, RouterModule} from '@angular/router';
+import {RouterModule, Routes} from '@angular/router';
import {PackagesDashboardComponent} from './packages-dashboard/packages-dashboard.component';
import {DesignerComponent} from './designer/designer.component';
import {PackageCreationComponent} from './package-creation/package-creation.component';
import {ConfigurationDashboardComponent} from './configuration-dashboard/configuration-dashboard.component';
-import { DesignerSourceViewComponent } from './designer/source-view/source-view.component';
+import {DesignerSourceViewComponent} from './designer/source-view/source-view.component';
+import {ComponentCanDeactivateGuard} from '../../../common/core/canDactivate/ComponentCanDeactivateGuard';
const routes: Routes = [
},
{path: 'designer/:id', component: DesignerComponent},
{path: 'designer/source/:id', component: DesignerSourceViewComponent},
- {path: 'package/:id', component: ConfigurationDashboardComponent},
- {path: 'createPackage', component: PackageCreationComponent}
+ {path: 'package/:id', component: ConfigurationDashboardComponent, canDeactivate: [ComponentCanDeactivateGuard]},
+ {path: 'createPackage', component: PackageCreationComponent, canDeactivate: [ComponentCanDeactivateGuard]}
];
@NgModule({
-import {TestBed} from '@angular/core/testing';
-import {PackagesStore} from './packages.store';
-import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
-import {PackagesApiService} from './packages-api.service';
-import {of} from 'rxjs';
-import {BluePrintPage} from './model/BluePrint.model';
-import {getBluePrintPageMock} from './blueprint.page.mock';
-import {PackagesDashboardState} from './model/packages-dashboard.state';
-
-fdescribe('PackagesStore', () => {
- let store: PackagesStore;
+import { TestBed } from '@angular/core/testing';
+import { PackagesStore } from './packages.store';
+import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
+import { PackagesApiService } from './packages-api.service';
+import { of } from 'rxjs';
+import { BluePrintPage } from './model/BluePrint.model';
+import { getBluePrintPageMock } from './blueprint.page.mock';
+import { PackagesDashboardState } from './model/packages-dashboard.state';
+
+describe('PackagesStore', () => {
+ // store: PackagesStore;
const MOCK_BLUEPRINTS_PAGE: BluePrintPage = getBluePrintPageMock();
// set the value to return when the ` getPagedPackages` spy is called.
packagesServiceSpy.getPagedPackages.and.returnValue(of([MOCK_BLUEPRINTS_PAGE]));
- store = new PackagesStore(packagesServiceSpy);
+ // store = new PackagesStore(packagesServiceSpy);
// Todo check the Abbas's code
/*store.getPagedPackages(0, 2);
// set the value to return when the `getPagedPackages` spy is called.
packagesServiceSpy.getPagedPackages.and.returnValue(of([MOCK_BLUEPRINTS_PAGE]));
- store = new PackagesStore(packagesServiceSpy);
- store.getAll();
- store.state$.subscribe(page => {
- expect(store.state.page).toEqual(MOCK_BLUEPRINTS_PAGE);
- });
+ // store = new PackagesStore(packagesServiceSpy);
+ // store.getAll();
+ // store.state$.subscribe(page => {
+ // expect(store.state.page).toEqual(MOCK_BLUEPRINTS_PAGE);
+ // });
});
});
})
export class PackagesStore extends Store<PackagesDashboardState> {
// TDOD fixed for now as there is no requirement to change it from UI
- public pageSize = 5;
+ public pageSize = 15;
private bluePrintContent: BluePrintPage = new BluePrintPage();
constructor(
<glyph unicode="" glyph-name="icon-enrich" horiz-adv-x="723" d="M643.818 562.272h-240.316l20.882 363.431c1.945 33.821-43.138 47.578-60.352 18.306l-312.986-532.253c-12.694-21.586 2.893-48.888 27.965-48.888h240.317l-20.884-363.431c-1.945-33.823 43.14-47.574 60.352-18.306l312.986 532.251c12.692 21.589-2.895 48.89-27.965 48.89zM370.919 129.754l15.154 263.697c1.069 18.617-13.757 34.301-32.389 34.301h-217.964l216.186 367.635-15.152-263.698c-1.069-18.617 13.757-34.301 32.389-34.301h217.962l-216.186-367.633zM67.885 180.705l-56.849-56.849c-12.669-12.669-12.669-33.209 0-45.878 12.667-12.669 33.209-12.671 45.878 0l56.849 56.849c12.669 12.669 12.669 33.209 0 45.878-12.667 12.671-33.209 12.671-45.878 0zM67.885 714.493c12.667-12.669 33.209-12.671 45.878 0 12.669 12.669 12.669 33.209 0 45.878l-56.849 56.849c-12.667 12.669-33.209 12.669-45.878 0s-12.669-33.209 0-45.878l56.849-56.849zM654.942 180.705c-12.667 12.669-33.209 12.669-45.878 0s-12.669-33.209 0-45.878l56.849-56.849c12.667-12.669 33.209-12.671 45.878 0 12.669 12.669 12.669 33.209 0 45.878l-56.849 56.849zM654.942 714.493l56.849 56.849c12.669 12.669 12.669 33.209 0 45.878-12.667 12.669-33.209 12.669-45.878 0l-56.849-56.849c-12.669-12.669-12.669-33.209 0-45.878 12.665-12.667 33.209-12.669 45.878 0z" />
<glyph unicode="" glyph-name="icon-get_started" d="M1003.008 959.872c-199.893 3.584-427.861-100.907-572.16-262.997-137.899-2.603-272.171-59.136-371.029-157.995-5.76-5.675-7.808-14.165-5.291-21.845 2.56-7.723 9.216-13.312 17.237-14.464l164.437-23.552-20.309-22.741c-7.552-8.448-7.168-21.291 0.853-29.312l274.219-274.219c4.139-4.139 9.6-6.229 15.104-6.229 5.077 0 10.155 1.792 14.208 5.419l22.741 20.309 23.552-164.437c1.152-8.021 7.467-13.909 15.104-16.469 1.963-0.64 4.011-0.939 6.101-0.939 6.059 0 12.245 2.645 16.512 6.869 97.493 97.493 154.027 231.765 156.629 369.664 162.261 144.597 267.605 372.48 262.955 572.117-0.299 11.349-9.472 20.523-20.864 20.821zM806.4 591.573c-20.779-20.779-48.085-31.189-75.435-31.189s-54.656 10.411-75.435 31.189c-41.557 41.6-41.557 109.269 0 150.869 41.6 41.6 109.269 41.6 150.869 0s41.6-109.312 0-150.869zM116.224 238.72c-45.653-45.653-108.331-251.904-115.328-275.243-2.261-7.509-0.171-15.659 5.333-21.205 4.096-4.096 9.515-6.272 15.104-6.272 2.048 0 4.096 0.299 6.144 0.896 23.339 6.997 229.589 69.675 275.243 115.328 51.413 51.413 51.413 135.083 0 186.496-51.456 51.413-135.083 51.371-186.496 0z" />
<glyph unicode="" glyph-name="icon-user_guide" d="M182.318 221.526v738.474h-49.18c-72.456 0-131.404-58.948-131.404-131.404v-648.796c30.102 25.97 69.248 41.728 112.030 41.728h68.554zM795.95 450.1c6.458 0 12.862-0.236 19.214-0.66v510.56h-572.956v-738.474h273.492c26.68 130.278 142.202 228.574 280.25 228.574zM423.968 783.658h200.44v-59.89h-200.44zM356.262 653.638h335.852v-59.89h-335.852zM549.012 19.818h-395.51v59.89h369.092c-8.198 26.514-12.636 54.66-12.688 83.818h-396.142c-62.73 0-113.764-51.034-113.764-113.762 0-62.73 51.034-113.764 113.764-113.764h509.716c-29.982 22.73-55.356 51.222-74.468 83.818zM795.95 392.1c-125.748 0-228.052-102.302-228.052-228.050s102.304-228.050 228.052-228.050c125.746 0 228.050 102.304 228.050 228.050 0 125.748-102.304 228.050-228.050 228.050zM795.928 300.576c16.818 0 29.272-13.746 30-30 0.726-16.202-14.308-30-30-30-16.818 0-29.272 13.746-30 30-0.726 16.202 14.308 30 30 30zM825.996 47.13h-60v153.598h60z" />
+<glyph unicode="" glyph-name="icon-autoMap" horiz-adv-x="904" d="M865.588 451.765c0-65.786-53.332-119.118-119.118-119.118s-119.118 53.332-119.118 119.118c0 65.786 53.332 119.118 119.118 119.118s119.118-53.332 119.118-119.118zM19.853 940.147h230.294v-230.294h-230.294zM19.853 193.676h230.294v-230.294h-230.294zM19.853 566.912h230.294v-230.294h-230.294zM885.441 451.765c0 76.628-62.343 138.971-138.971 138.971s-138.971-62.343-138.971-138.971c0-76.628 62.343-138.971 138.971-138.971s138.971 62.343 138.971 138.971zM746.471 352.5c-54.735 0-99.265 44.53-99.265 99.265s44.53 99.265 99.265 99.265c54.735 0 99.265-44.53 99.265-99.265s-44.53-99.265-99.265-99.265zM250.147 960h-230.294c-10.966 0-19.853-8.887-19.853-19.853v-230.294c0-10.966 8.887-19.853 19.853-19.853h230.294c10.966 0 19.853 8.887 19.853 19.853v230.294c0 10.966-8.887 19.853-19.853 19.853zM230.294 729.706h-190.588v190.588h190.588v-190.588zM250.147 213.529h-230.294c-10.966 0-19.853-8.887-19.853-19.853v-230.294c0-10.966 8.887-19.853 19.853-19.853h230.294c10.966 0 19.853 8.887 19.853 19.853v230.294c0 10.966-8.887 19.853-19.853 19.853zM230.294-16.765h-190.588v190.588h190.588v-190.588zM250.147 586.765h-230.294c-10.966 0-19.853-8.887-19.853-19.853v-230.294c0-10.966 8.887-19.853 19.853-19.853h230.294c10.966 0 19.853 8.887 19.853 19.853v230.294c0 10.966-8.887 19.853-19.853 19.853zM230.294 356.471h-190.588v190.588h190.588v-190.588zM329.559 431.912h138.971l-31.765-23.824c-8.771-6.576-10.547-19.023-3.971-27.794 3.901-5.196 9.864-7.941 15.898-7.941 4.149 0 8.321 1.295 11.896 3.971l79.412 59.559c0.101 0.070 7.941 5.956 7.941 15.882 0 6.126-3.017 12.214-7.941 15.882l-79.412 59.559c-8.771 6.584-21.218 4.8-27.794-3.971s-4.8-21.218 3.971-27.794l31.765-23.824h-138.971c-10.966 0-19.853-8.887-19.853-19.853s8.887-19.853 19.853-19.853zM329.559 805.147h168.463l138.971-138.971h-49.345c-10.966 0-19.853-8.887-19.853-19.853s8.887-19.853 19.853-19.853h99.265c12.726 0 22.621 13.215 19.062 25.413l-27.794 95.294c-3.071 10.524-14.099 16.58-24.622 13.502-10.524-3.071-16.565-14.091-13.494-24.622l6.91-23.699-126.687 126.687c-3.722 3.715-8.771 5.809-14.037 5.809h-176.691c-10.966 0-19.853-8.887-19.853-19.853s8.887-19.853 19.853-19.853zM686.912 273.088h-99.265c-10.966 0-19.853-8.887-19.853-19.853s8.887-19.853 19.853-19.853h49.345l-138.971-138.971h-168.463c-10.966 0-19.853-8.887-19.853-19.853s8.887-19.853 19.853-19.853h176.691c5.266 0 10.314 2.094 14.037 5.816l126.687 126.687-6.918-23.707c-3.071-10.531 2.978-21.551 13.502-24.615 1.861-0.543 3.73-0.807 5.568-0.807 8.6 0 16.518 5.638 19.054 14.3 0 0 27.662 94.86 27.794 95.294 3.552 12.206-6.39 25.413-19.062 25.413v0z" />
+<glyph unicode="" glyph-name="icon-required-star" d="M996.821 593.749l-314.795 48.085-141.099 300.544c-10.539 22.443-47.36 22.443-57.899 0l-141.056-300.544-314.795-48.085c-25.856-3.968-36.181-35.413-18.048-53.973l228.693-234.411-54.059-331.392c-4.309-26.325 23.808-46.080 47.061-33.152l281.173 155.392 281.173-155.435c23.040-12.8 51.413 6.571 47.061 33.152l-54.059 331.392 228.693 234.411c18.133 18.603 7.765 50.048-18.048 54.016v0z" />
+<glyph unicode="" glyph-name="icon-source" horiz-adv-x="1365" d="M451.884 287.277c-0.917 6.337-4.31 12.047-9.433 15.881l-259.965 194.408 259.965 194.408c5.123 3.834 8.516 9.544 9.433 15.881 0.91 6.337-0.724 12.771-4.565 17.908l-41.298 55.22c-7.992 10.674-23.107 12.86-33.782 4.868l-359.655-268.957c-6.089-4.551-9.681-11.716-9.681-19.328s3.593-14.777 9.681-19.328l359.655-268.957c4.33-3.248 9.406-4.806 14.433-4.806 7.351 0 14.612 3.337 19.349 9.675l41.298 55.22c3.834 5.137 5.475 11.571 4.565 17.908zM1349.929 516.894l-359.641 268.957c-10.674 7.985-25.79 5.799-33.775-4.868l-41.298-55.22c-3.834-5.13-5.475-11.571-4.565-17.908 0.917-6.33 4.303-12.047 9.433-15.881l259.958-194.408-259.958-194.408c-5.13-3.834-8.516-9.55-9.433-15.881-0.91-6.337 0.724-12.778 4.565-17.908l41.298-55.22c4.744-6.337 11.998-9.675 19.349-9.675 5.027 0 10.095 1.565 14.433 4.806l359.641 268.957c6.089 4.551 9.681 11.716 9.681 19.328s-3.6 14.777-9.688 19.328zM912.043 929.411l-63.516 26.858c-5.889 2.496-12.536 2.538-18.473 0.138-5.93-2.407-10.668-7.068-13.157-12.964l-379.259-897.010c-5.192-12.274 0.552-26.438 12.833-31.63l63.516-26.858c3-1.276 6.199-1.903 9.399-1.903 3.082 0 6.165 0.593 9.075 1.772 5.93 2.407 10.661 7.068 13.157 12.964l379.259 897.010c5.186 12.274-0.559 26.431-12.833 31.623z" />
+<glyph unicode="" glyph-name="icon-add-circle" d="M512 960c-282.785 0-512-229.215-512-512s229.215-512 512-512c282.785 0 512 229.249 512 512s-229.215 512-512 512zM512 0c-247.425 0-448 200.575-448 448s200.575 448 448 448c247.425 0 448-200.575 448-448s-200.575-448-448-448zM704 480h-160v160c0 17.664-14.336 32-32 32s-32-14.336-32-32v-160h-160c-17.664 0-32-14.336-32-32s14.336-32 32-32h160v-160c0-17.664 14.336-32 32-32s32 14.336 32 32v160h160c17.664 0 32 14.336 32 32s-14.336 32-32 32z" />
+<glyph unicode="" glyph-name="icon-function-attribute" horiz-adv-x="1229" d="M1166.428 461.798c3.568 8.632 1.58 18.556-5.028 25.151l-415.328 415.328c-9.167 8.851-23.772 8.598-32.629-0.569-8.633-8.944-8.633-23.117 0-32.058l375.967-375.967h-1005.695c-12.742-0.002-23.075-10.331-23.075-23.077s10.331-23.075 23.075-23.075h1005.695l-375.918-375.918c-9.167-8.851-9.42-23.46-0.569-32.629 8.851-9.167 23.46-9.418 32.629-0.569 0.192 0.188 0.38 0.373 0.569 0.569l415.328 415.328c2.132 2.144 3.826 4.686 4.981 7.481zM729.778 32.212c-12.742-0.026-23.094 10.289-23.114 23.035-0.012 6.144 2.431 12.036 6.778 16.376l399.041 398.99-399.041 398.992c-8.851 9.167-8.598 23.772 0.569 32.629 8.944 8.633 23.117 8.633 32.058 0l415.328-415.328c9.010-9.012 9.010-23.615 0-32.629l-415.328-415.328c-4.321-4.312-10.178-6.736-16.29-6.736zM1145.107 447.538h-1061.393c-12.742 0-23.075 10.331-23.075 23.072s10.331 23.075 23.075 23.075h1061.396c12.742 0 23.075-10.331 23.075-23.075s-10.331-23.072-23.077-23.072z" />
+<glyph unicode="" glyph-name="icon-custom-attribute" d="M35.552 421.088c-19.808 0-35.552 16.256-35.552 36.064s15.744 35.552 35.552 35.552h431.2v431.232c0.032 19.808 16.288 36.064 36.096 36.064s35.552-16.256 35.552-36.064v-431.232h431.2c19.808 0 36.064-15.744 36.064-35.552s-16.256-36.064-36.064-36.064h-431.2v-431.232c0-19.808-15.744-36.064-35.552-36.064s-36.064 16.256-36.064 36.064v431.232h-431.232z" />
<glyph unicode="" glyph-name="icon-add" d="M512 960c-282.785 0-512-229.215-512-512s229.215-512 512-512c282.785 0 512 229.249 512 512s-229.215 512-512 512zM512 0c-247.425 0-448 200.575-448 448s200.575 448 448 448c247.425 0 448-200.575 448-448s-200.575-448-448-448zM704 480h-160v160c0 17.664-14.336 32-32 32s-32-14.336-32-32v-160h-160c-17.664 0-32-14.336-32-32s14.336-32 32-32h160v-160c0-17.664 14.336-32 32-32s32 14.336 32 32v160h160c17.664 0 32 14.336 32 32s-14.336 32-32 32z" />
<glyph unicode="" glyph-name="icon-archive-sm" d="M943.405 684.258h-864.783c-10.653 0-19.867-3.887-27.644-11.668-7.781-7.777-11.668-16.991-11.668-27.637v-589.626c0-10.644 3.887-19.863 11.668-27.637 7.777-7.781 16.991-11.677 27.644-11.677h864.783c10.647 0 19.854 3.896 27.637 11.677 7.775 7.773 11.662 16.991 11.662 27.637v589.626c0 10.653-3.872 19.858-11.662 27.637-7.775 7.781-16.991 11.668-27.637 11.668zM617.255 499.387c-7.773-7.779-16.991-11.668-27.637-11.668h-157.233c-10.64 0-19.854 3.892-27.637 11.668-7.777 7.781-11.668 16.991-11.668 27.644 0 10.644 3.892 19.858 11.668 27.637 7.781 7.781 16.995 11.673 27.637 11.673h157.249c10.638 0 19.85-3.892 27.637-11.673 7.775-7.777 11.662-16.991 11.662-27.637 0-10.651-3.896-19.863-11.677-27.644zM1010.357 947.749c-7.783 7.781-16.991 11.668-27.639 11.668h-943.409c-10.644 0-19.858-3.887-27.637-11.668-7.779-7.777-11.671-16.991-11.671-27.637v-157.233c0-10.644 3.892-19.854 11.673-27.637 7.779-7.781 16.991-11.668 27.637-11.668h943.394c10.644 0 19.863 3.887 27.652 11.668 7.773 7.781 11.66 16.991 11.66 27.637v157.233c0 10.653-3.887 19.86-11.66 27.637z" />
<glyph unicode="" glyph-name="icon-btn-card-config" d="M971.283 561.778h-95.801c-15.398 0-28.084 8.476-33.982 22.699s-2.901 29.203 7.964 40.088l67.736 67.717c9.956 9.956 15.436 23.211 15.436 37.281 0 14.089-5.48 27.326-15.436 37.3l-86.338 86.338c-19.911 19.911-54.632 19.949-74.581 0l-67.717-67.717c-10.885-10.866-25.903-13.9-40.088-7.983-14.222 5.897-22.699 18.584-22.699 33.982v95.801c0 29.070-23.647 52.717-52.717 52.717h-122.121c-29.070 0-52.717-23.647-52.717-52.717v-95.801c0-15.398-8.476-28.084-22.699-33.982-14.184-5.935-29.203-2.882-40.088 7.983l-67.717 67.717c-19.949 19.949-54.67 19.911-74.581 0l-86.338-86.338c-9.956-9.956-15.436-23.211-15.436-37.3 0-14.071 5.48-27.307 15.436-37.281l67.736-67.717c10.866-10.885 13.843-25.865 7.964-40.088s-18.584-22.699-33.982-22.699h-95.801c-29.070 0-52.717-23.647-52.717-52.717v-122.103c0-29.089 23.647-52.736 52.717-52.736h95.801c15.398 0 28.084-8.476 33.982-22.699s2.901-29.203-7.964-40.088l-67.736-67.717c-9.956-9.956-15.436-23.211-15.436-37.281 0-14.089 5.48-27.326 15.436-37.3l86.338-86.338c19.93-19.93 54.632-19.968 74.581 0l67.717 67.736c10.885 10.866 25.847 13.862 40.088 7.964 14.222-5.897 22.699-18.584 22.699-33.982v-95.801c0-29.070 23.647-52.717 52.717-52.717h122.103c29.070 0 52.717 23.647 52.717 52.717v95.801c0 15.398 8.476 28.084 22.699 33.982 14.241 5.916 29.203 2.901 40.088-7.964l67.717-67.736c19.949-19.949 54.67-19.911 74.581 0l86.338 86.338c9.956 9.956 15.436 23.211 15.436 37.3 0 14.071-5.48 27.307-15.436 37.281l-67.736 67.717c-10.866 10.885-13.843 25.865-7.964 40.088s18.603 22.699 34.001 22.699h95.801c29.070 0 52.717 23.647 52.717 52.717v122.121c0 29.070-23.647 52.717-52.717 52.717zM986.074 386.939c0-8.154-6.637-14.791-14.791-14.791h-95.801c-30.796 0-57.249-17.673-69.025-46.118-11.795-28.444-5.594-59.657 16.194-81.427l67.736-67.717c5.784-5.784 5.784-15.17 0-20.935l-86.338-86.338c-5.765-5.765-15.151-5.803-20.935 0l-67.717 67.736c-21.788 21.788-52.983 27.951-81.427 16.194-28.444-11.776-46.118-38.229-46.118-69.025v-95.801c0-8.154-6.637-14.791-14.791-14.791h-122.121c-8.154 0-14.791 6.637-14.791 14.791v95.801c0 30.796-17.673 57.249-46.118 69.025-9.538 3.963-19.361 5.897-29.070 5.897-19.228 0-37.869-7.585-52.357-22.073l-67.717-67.736c-5.803-5.803-15.189-5.765-20.935 0l-86.338 86.338c-5.784 5.784-5.784 15.17 0 20.935l67.736 67.717c21.769 21.769 27.989 52.983 16.194 81.427-11.776 28.425-38.229 46.099-69.025 46.099h-95.801c-8.154 0-14.791 6.637-14.791 14.791v122.121c0 8.154 6.637 14.791 14.791 14.791h95.801c30.796 0 57.249 17.673 69.025 46.118 11.795 28.444 5.594 59.657-16.194 81.427l-67.736 67.717c-5.784 5.784-5.784 15.17 0 20.935l86.338 86.338c5.765 5.784 15.151 5.784 20.935 0l67.717-67.717c21.751-21.751 52.945-27.989 81.427-16.194 28.444 11.757 46.118 38.21 46.118 69.006v95.801c0 8.154 6.637 14.791 14.791 14.791h122.103c8.173 0 14.81-6.637 14.81-14.791v-95.801c0-30.796 17.673-57.249 46.118-69.025 28.482-11.795 59.657-5.575 81.427 16.194l67.717 67.717c5.803 5.784 15.189 5.784 20.935 0l86.338-86.338c5.784-5.784 5.784-15.17 0-20.935l-67.736-67.717c-21.769-21.769-27.989-52.983-16.194-81.427 11.776-28.444 38.229-46.118 69.025-46.118h95.801c8.154 0.019 14.791-6.618 14.791-14.772v-122.121zM512 618.667c-94.113 0-170.667-76.553-170.667-170.667s76.553-170.667 170.667-170.667c94.113 0 170.667 76.553 170.667 170.667s-76.553 170.667-170.667 170.667zM512 315.259c-73.178 0-132.741 59.563-132.741 132.741s59.563 132.741 132.741 132.741c73.178 0 132.741-59.563 132.741-132.741s-59.563-132.741-132.741-132.741z" />
@font-face {
font-family: 'icomoon';
- src: url('fonts/icomoon.eot?pqs8r8');
- src: url('fonts/icomoon.eot?pqs8r8#iefix') format('embedded-opentype'),
- url('fonts/icomoon.ttf?pqs8r8') format('truetype'),
- url('fonts/icomoon.woff?pqs8r8') format('woff'),
- url('fonts/icomoon.svg?pqs8r8#icomoon') format('svg');
+ src: url('fonts/icomoon.eot?h11si2');
+ src: url('fonts/icomoon.eot?h11si2#iefix') format('embedded-opentype'),
+ url('fonts/icomoon.ttf?h11si2') format('truetype'),
+ url('fonts/icomoon.woff?h11si2') format('woff'),
+ url('fonts/icomoon.svg?h11si2#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
-moz-osx-font-smoothing: grayscale;
}
+.icon-function-attribute:before {
+ content: "\e90e";
+}
+.icon-custom-attribute:before {
+ content: "\e90f";
+ color: #1b3e6f;
+}
+.icon-add-circle:before {
+ content: "\e90d";
+ color: #103d73;
+}
+.icon-required-star:before {
+ content: "\e90b";
+ color: #ff6469;
+}
+.icon-source:before {
+ content: "\e90c";
+}
+.icon-autoMap:before {
+ content: "\e90a";
+}
.icon-get_started:before {
content: "\e908";
}
--- /dev/null
+<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="trash" class="svg-inline--fa fa-trash fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"></path></svg>
\ No newline at end of file
transition: 0.3s !important;
}
/*Bootstrap*/
+.custom-control-input:checked ~ .custom-control-label::before{
+ border-color: transparent !important;
+}
.btn-outline-danger{
background: #fff !important;
border: solid 1px #ECEDF2 !important;
border: solid 1px #C3CDDB !important;
border-radius: 0 !important;
}
+.reuiredInput .custom-control-label::before{
+ width: 18px !important;
+ height: 18px !important;
+ border-radius: 50% !important;
+}
+
+.reuiredInput .custom-control-label::after{
+ content: "_";
+ color: #C4CEDB !important;
+ width: 18px !important;
+ height: 18px !important;
+ line-height: 6px;
+ text-align: center;
+}
+.reuiredInput .custom-control-input:checked ~ .custom-control-label::after{
+ top: 4px !important;
+ left: -24px !important;
+ content: "";
+}
+.reuiredInput .custom-control-input:checked ~ .custom-control-label::before{
+ background: #66BB00 !important;
+}
.custom-control-input:checked ~ .custom-control-label::before{
background: #1B3E6F !important;
}
text-indent: unset;
text-align: center;
}
+.helpMenu li:hover,
+.helpMenu li:hover i,
+.helpMenu li:hover p{
+ cursor: pointer;
+}
.helpMenu li:not(:last-child){
margin-bottom: 9px;
}
padding: 6px;
}
.helpMenu .dropdown-content a{
- padding: 0 12px;
+ padding: 5px 12px !important;
text-align: left;
text-indent: 0;
font-size: 14px;
-webkit-box-shadow: 0 4px 10px 0 #eef0f5;
box-shadow: 0 4px 10px 0 #eef0f5;
position: relative;
- z-index: 8;
+ z-index: 300;
/* position: fixed;
width: calc(100% - 50px); */
}
margin-bottom: 26px;
width: 100px;
height: 30px;
+ line-height: 15px;
background: #1B3E6F;
color: #fff;
font-size: 12px;
color: #1B3E6F;
content: attr(data-tooltip);
font-size: 12px;
+ font-weight: bold !important;
line-height: 1.2;
border-radius: 3px;
}
color:#1B3E6F;
background-color: #C3CDDB !important;
border: solid 1px #C3CDDB;
- border-radius: 3px !important;
- border-top-left-radius: 0 !important;
+ border-radius: 1px !important;
+ /* border-top-left-radius: 0 !important; */
font-size: 12px;
opacity: 1.0 !important;
}
-.bs-tooltip-auto[x-placement^=top] .arrow::before, .bs-tooltip-top .arrow::before {
+.bs-tooltip-auto[x-placement^=top] .arrow::before,
+.bs-tooltip-top .arrow::before {
border-top-color: #C3CDDB !important;
}
-.bs-tooltip-auto[x-placement^=right] .arrow::before, .bs-tooltip-right .arrow::before {
+.bs-tooltip-auto[x-placement^=right] .arrow::before,
+.bs-tooltip-right .arrow::before {
border-right-color: #C3CDDB !important;
}
-.bs-tooltip-auto[x-placement^=bottom] .arrow::before, .bs-tooltip-bottom .arrow::before {
+.bs-tooltip-auto[x-placement^=bottom] .arrow::before,
+.bs-tooltip-bottom .arrow::before {
border-bottom-color: #C3CDDB !important;
}
-.bs-tooltip-auto[x-placement^=left] .arrow::before, .bs-tooltip-left .arrow::before {
+.bs-tooltip-auto[x-placement^=left] .arrow::before,
+.bs-tooltip-left .arrow::before {
border-left-color: #C3CDDB !important;
}
}
-.action-button.delete i{
+/* .action-button.delete i{
color: #BABBC3;
-}
+} */
+.action-button.delete,
+.action-button.delete i,
.action-button.delete:hover,
.action-button.delete:hover .icon-delete-sm{
color: #FF6469 !important;
top: 13px;
}
.ace_scroller{
- overflow: auto !important;
+ /* overflow: auto !important; */
}
.ace_print-margin{
left: 100% !important;
.mapping-source-load.hover-disable:hover i{
background: transparent;
}
+.mapping-editBar{
+ margin-bottom: 1rem;
+}
+.mapping-editBar .custom-checkbox,
+.mapping-editBar .btn{
+ margin: 0 4px !important;
+ padding: 9px !important;
+ width: 36px;
+ height: 36px;
+ background: #F4F9FE;
+ border-radius: 50% !important;
+ text-align: center;
+ line-height: 14px;
+}
+.mapping-editBar .custom-checkbox{
+ margin-left: 0 !important;
+}
+.mapping-editBar .custom-control-label{
+ top: -2px;
+ left: 16px;
+}
+.mapping-editBar .btn i{
+ color: #1B3E6F;
+ font-size: 18px;
+ opacity: .5;
+}
+.mapping-editBar .custom-checkbox:hover,
+.mapping-editBar .btn:hover i{
+ opacity: 1;
+}
.template-mapping-list{
background: #F4F9FE;
border: 1px solid #E9F3FF;
}
.template-mapping-list:hover,
.template-mapping-list.active {
+ cursor: pointer;
/* background: #1B3E6F; */
text-decoration: none;
/* color: #fff !important; */
font-size: 13px;
}
.template-mapping-action .btn-primary{
- background:#5DBDBA !important ;
- border-color:#5DBDBA !important ;
+ background:#66BB00 !important ;
+ border-color:#66BB00 !important ;
color: #fff !important ;
}
.template-mapping-action .btn-outline-secondary{
overflow: auto;
padding: 20px;
padding-top: 9px;
- background: #fff;
- color: #1B3E6F;
+ background: #1B3E6F;
+ color: #fff;
border-top: solid 6px #1273EB;
- box-shadow: 0 2px 6px 0 rgba(47, 83, 151, 0.18) !important;
+ box-shadow: 0 2px 13px 6px rgba(47, 83, 151, .17) !important;
border-radius: 3px !important;
/* border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important; */
border: 0;
background: none;
font-weight: normal;
- color: #1273EB;
+ color: #E0E8F2;
font-size: 12px;
}
/*Wizard Content*/
.mat-menu-panel{
- box-shadow: 0 2px 6px 0 rgba(47, 83, 151, 0.18) !important;
+ box-shadow: 0 2px 13px 6px rgba(47, 83, 151, .17) !important;
border-radius: 3px !important;
- border-bottom: solid 3px #1273EB;
+ border-top: solid 3px #1273EB;
}
.mat-menu-panel::after {
content: '';
position: absolute;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
- border-bottom: 8px solid #fff;
+ border-bottom: 8px solid #1273EB;
left: 9px;
top: -8px;
}
.mat-card{
- background: #fff !important;
- color: #1B3E6F !important;
+ background: #1B3E6F !important;
+ color: #fff !important;
font-family: inherit !important;
border-radius: 0 !important;
}
font-size: 16px !important;
}
.mat-icon-button[disabled]{
- color: rgba(27, 62, 111, .5) !important;
+ color: rgba(224, 232, 242, .5) !important;
}
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- <relativePath/>
+ <groupId>org.onap.ccsdk.cds</groupId>
+ <artifactId>cds-aggregator</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
- <groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ui</artifactId>
<packaging>pom</packaging>
- <name>CDS UI Parent</name>
+ <name>UI Parent</name>
<description>Creates Controller Design Studio UI Docker container</description>
<modules>
</modules>
<properties>
- <image.name>onap/ccsdk-cds-ui</image.name>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <docker.verbose>true</docker.verbose>
+ <npm.executable>npm</npm.executable>
</properties>
</project>
<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<!--
============LICENSE_START==========================================
===================================================================
Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ui</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
- <artifactId>ui-server</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ui-server</artifactId>
<packaging>pom</packaging>
- <name>CDS UI Server</name>
+ <name>UI Server</name>
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <npm.executable>npm</npm.executable>
- <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
<image.name>onap/ccsdk-cds-ui-server</image.name>
- <docker.push.phase>deploy</docker.push.phase>
</properties>
<build>
<configuration>
<artifactItems>
<artifactItem>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
- <version>${project.version}</version>
+ <version>${ccsdk.cds.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/generated/proto-definition/proto</outputDirectory>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.26.1</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
- <verbose>true</verbose>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
+ <id>build-push-images</id>
<phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
if (appConfig.action.grpcEnabled)
return this.uploadFileToBlueprintProcessorGrpc(file, 'PUBLISH', response);
else
- return this.uploadFileToBlueprintProcessor(file, '/execution-service/upload/', response);
+ return this.uploadFileToBlueprintProcessor(file, '/blueprint-model/publish', response);
}, err => {
reject(err);
});
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
+ <artifactId>blueprintsprocessor-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../ms/blueprintsprocessor/parent</relativePath>
</parent>
<artifactId>cba-parent</artifactId>
<packaging>pom</packaging>
- <name>CBA Parent</name>
+ <name>Components CBA Parent</name>
<build>
<sourceDirectory>${project.basedir}/Scripts/kotlin</sourceDirectory>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
<artifactId>cba-assembly-descriptor</artifactId>
- <name>CBA - Assembly Descriptor</name>
+ <name>Components Model Catalog - Blueprints Model - CBA Assembly Descriptor</name>
<description>Shared assembly descriptor</description>
<build>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<!-- create a tar.gz file containing the projects dependencies -->
- <id>cba_zip</id>
+ <id>cba</id>
<formats>
<format>zip</format>
</formats>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
<artifactId>cba-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../../../ms/blueprintsprocessor/cba-parent</relativePath>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../cba-parent</relativePath>
</parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>CBA - Blueprints</name>
- <description>CBA - Blueprints</description>
+ <name>Components Model Catalog - Blueprints Model</name>
<modules>
<module>test-blueprint</module>
{
- "data_types": {
- "dt-config-assign-properties": {
- "description": "Dynamic DataType definition for workflow(config-assign).",
- "version": "1.0.0",
- "properties": {
- "vdns_int_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_vf_module_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "data_types" : {
+ "dt-HealthCheck-properties" : {
+ "description" : "Dynamic DataType definition for workflow(HealthCheck).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-config-deploy-properties": {
- "description": "Dynamic DataType definition for workflow(config-deploy).",
- "version": "1.0.0",
- "properties": {
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "ip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-ScaleOutReconfiguration-properties" : {
+ "description" : "Dynamic DataType definition for workflow(ScaleOutReconfiguration).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_vf_module_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-HealthCheck-properties": {
- "description": "Dynamic DataType definition for workflow(config-deploy).",
- "version": "1.0.0",
- "properties": {
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "ip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-config-assign-properties" : {
+ "description" : "Dynamic DataType definition for workflow(config-assign).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_vf_module_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-ScaleOutReconfiguration-properties": {
- "description": "Dynamic DataType definition for workflow(config-deploy).",
- "version": "1.0.0",
- "properties": {
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "ip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_int_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_vf_module_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-config-deploy-properties" : {
+ "description" : "Dynamic DataType definition for workflow(config-deploy).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-vf-config-assign-properties": {
- "description": "Dynamic DataType definition for workflow(config-assign).",
- "version": "1.0.0",
- "properties": {
- "vdns_int_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_vf_module_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-resource-assignment-properties" : {
+ "description" : "Dynamic DataType definition for workflow(resource-assignment).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vlb_int_pktgen_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "private1-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "private1",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vdns_onap_private_ip_0.replaceAll(\"/.+\", \"\")}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "public_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-assign" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vf-module-assign}_${service-instance-id}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "sec_group" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nfc-naming-code" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnfc-model-invariant-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nexus_artifact_repo" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vdns_int_private_ip_0.replaceAll(\"/.+\", \"\")}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "dcae_collector_ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vip.replaceAll(\"/.+\", \"\")}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-naming-policy" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vnf_name}_${int_private_net_id}"
+ },
+ "default" : "private1",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vfccustomizationuuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "demo_artifacts_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-model-customization-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vnf_name}_${int_private_subnet_id}_subnet"
+ },
+ "default" : "private1",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "key_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_0_int_pktgen_private_port_0_mac" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "install_script_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_pktgen_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vnf_name}_${int_pktgen_private_net_id}"
+ },
+ "default" : "private2",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vm-type" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "aic-cloud-region" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "gre_ipaddr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${gre_ipaddr.replaceAll(\"/.+\", \"\")}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-model-customization-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pg_int" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${pg_int.replaceAll(\"/.+\", \"\")}"
+ },
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "dcae_collector_port" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-label" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pktgen_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "private2-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnfc-model-version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nb_api_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_int_pktgen_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-type" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pub_key" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "management-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_pktgen_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "metadata" : {
+ "transform-template" : "${vnf_name}_${int_pktgen_private_subnet_id}_subnet"
+ },
+ "default" : "private2",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pktgen_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "private2",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "create-md-sal-vnf-param" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf_assign_aai" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "cloud_env" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_0_int_pktgen_private_port_0_mac" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-vf-config-deploy-properties": {
- "description": "Dynamic DataType definition for workflow(config-deploy).",
- "version": "1.0.0",
- "properties": {
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "ip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-vf-config-assign-properties" : {
+ "description" : "Dynamic DataType definition for workflow(vf-config-assign).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_vf_module_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
},
- "dt-resource-assignment-properties": {
- "description": "Dynamic DataType definition for workflow(resource-assignment).",
- "version": "1.0.0",
- "properties": {
- "vlb_int_pktgen_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_0_int_pktgen_private_port_0_mac": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-assign": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf_assign_aai": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_0_int_pktgen_private_port_0_mac": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "private1-prefix-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_private_net_cidr": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_image_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "public_net_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "sec_group": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "nfc-naming-code": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnfc-model-invariant-uuid": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "nexus_artifact_repo": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "onap_private_net_cidr": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_name_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_int_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "image_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "flavor_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "dcae_collector_ip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_name_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vip": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-naming-policy": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "int_private_net_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vfccustomizationuuid": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "onap_private_net_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "demo_artifacts_version": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_int_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf-model-customization-uuid": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "int_private_subnet_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "key_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_name_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "install_script_version": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "int_pktgen_private_net_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vm-type": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnf_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "keypair": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "onap_private_subnet_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "aic-cloud-region": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "gre_ipaddr": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-model-customization-uuid": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "pg_int": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_flavor_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "dcae_collector_port": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-label": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_flavor_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "pktgen_private_net_cidr": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_image_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "private2-prefix-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vdns_flavor_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vnfc-model-version": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "service-instance-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "nb_api_version": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vpg_int_pktgen_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vf-module-type": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "pub_key": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "management-prefix-id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "int_pktgen_private_subnet_id": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "create-md-sal-vnf-param": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_onap_private_ip_0": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "cloud_env": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- },
- "vlb_image_name": {
- "description": "",
- "required": false,
- "type": "string",
- "status": "",
- "constraints": [
- {}
- ],
- "entry_schema": {
- "type": ""
- }
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
- }
- }
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-vf-config-deploy-properties" : {
+ "description" : "Dynamic DataType definition for workflow(vf-config-deploy).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
+ },
+ "derived_from" : "tosca.datatypes.Dynamic"
+ }
+ }
}
\ No newline at end of file
{
- "node_types": {
- "component-resource-resolution": {
- "description": "This is Resource Assignment Component API",
- "version": "1.0.0",
- "attributes": {
- "assignment-params": {
- "required": true,
- "type": "string"
- }
- },
- "capabilities": {
- "component-node": {
- "type": "tosca.capabilities.Node"
- }
- },
- "interfaces": {
- "ResourceResolutionComponent": {
- "operations": {
- "process": {
- "inputs": {
- "resolution-key": {
- "description": "Key for service instance related correlation.",
- "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,
- "type": "boolean"
- },
- "resource-type": {
- "description": "Request type.",
- "required": false,
- "type": "string"
- },
- "resolution-summary": {
- "description": "Enable output list of ResourcesAssignmentData",
- "required": false,
- "type": "boolean"
- },
- "artifact-prefix-names": {
- "description": "Template , Resource Assignment Artifact Prefix names",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "request-id": {
- "description": "Request Id, Unique Id for the request.",
- "required": true,
- "type": "string"
- },
- "resource-id": {
- "description": "Resource Id.",
- "required": false,
- "type": "string"
- },
- "action-name": {
- "description": "Action Name of the process",
- "required": false,
- "type": "string"
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- }
- },
- "outputs": {
- "resource-assignment-params": {
- "required": true,
- "type": "string"
- },
- "status": {
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
+ "node_types" : {
+ "component-netconf-executor" : {
+ "description" : "This is Netconf Transaction Configuration Component API",
+ "version" : "1.0.0",
+ "attributes" : {
+ "response-data" : {
+ "required" : false,
+ "type" : "json"
+ }
},
- "component-script-executor": {
- "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"
- }
- },
- "interfaces": {
- "ComponentScriptExecutor": {
- "operations": {
- "process": {
- "inputs": {
- "script-type": {
- "description": "Script type, kotlin type is supported",
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "kotlin",
- "jython",
- "internal"
- ]
- }
- ],
- "default": "internal"
- },
- "script-class-reference": {
- "description": "Kotlin Script class name or jython script name.",
- "required": true,
- "type": "string"
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- }
- },
- "outputs": {
- "response-data": {
- "description": "Execution Response Data.",
- "required": false,
- "type": "string"
- },
- "status": {
- "description": "Status of the Component Execution ( success or failure )",
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
+ "capabilities" : {
+ "component-node" : {
+ "type" : "tosca.capabilities.Node"
+ }
},
- "source-capability": {
- "description": "This is Component Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "script-type": {
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "kotlin",
- "internal",
- "jython"
- ]
+ "requirements" : {
+ "netconf-connection" : {
+ "capability" : "netconf",
+ "node" : "vnf-netconf-device",
+ "relationship" : "tosca.relationships.ConnectsTo"
+ }
+ },
+ "interfaces" : {
+ "ComponentNetconfExecutor" : {
+ "operations" : {
+ "process" : {
+ "inputs" : {
+ "script-type" : {
+ "description" : "Script type, kotlin type is supported",
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "kotlin", "jython", "internal" ]
+ } ],
+ "default" : "internal"
+ },
+ "script-class-reference" : {
+ "description" : "Kotlin Script class name or jython script name.",
+ "required" : true,
+ "type" : "string"
+ },
+ "instance-dependencies" : {
+ "description" : "Instance names to inject to Jython or Kotlin Script.",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
}
- ],
- "default": "kotlin"
- },
- "script-class-reference": {
- "description": "Capability reference name for internal and kotlin, for jython script file path",
- "required": true,
- "type": "string"
- },
- "instance-dependencies": {
- "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "key-dependencies": {
- "description": "Resource Resolution dependency dictionary names.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
+ },
+ "dynamic-properties" : {
+ "description" : "Dynamic Json Content or DSL Json reference.",
+ "required" : false,
+ "type" : "json"
+ }
+ },
+ "outputs" : {
+ "response-data" : {
+ "description" : "Execution Response Data in JSON format.",
+ "required" : false,
+ "type" : "string"
+ },
+ "status" : {
+ "description" : "Status of the Component Execution ( success or failure )",
+ "required" : true,
+ "type" : "string"
+ }
+ }
}
- },
- "derived_from": "tosca.nodes.ResourceSource"
+ }
+ }
},
- "source-db": {
- "description": "This is Database Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "SQL",
- "PLSQL"
- ]
+ "derived_from" : "tosca.nodes.Component"
+ },
+ "component-resource-resolution" : {
+ "description" : "This is Resource Assignment Component API",
+ "version" : "1.0.0",
+ "attributes" : {
+ "assignment-params" : {
+ "description" : "Holds resolved template, resolution-summary or key-value",
+ "required" : true,
+ "type" : "string"
+ },
+ "assignment-map" : {
+ "description" : "Holds resolved values for each artifact prefix eg. { vdns: { vnf-id: 123 } }",
+ "required" : true,
+ "type" : "map"
+ }
+ },
+ "capabilities" : {
+ "component-node" : {
+ "type" : "tosca.capabilities.Node"
+ }
+ },
+ "interfaces" : {
+ "ResourceResolutionComponent" : {
+ "operations" : {
+ "process" : {
+ "inputs" : {
+ "resolution-key" : {
+ "description" : "Key for service instance related correlation.",
+ "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,
+ "type" : "boolean"
+ },
+ "resource-type" : {
+ "description" : "Request type.",
+ "required" : false,
+ "type" : "string"
+ },
+ "resolution-summary" : {
+ "description" : "Enable resolution-summary output",
+ "required" : false,
+ "type" : "boolean"
+ },
+ "artifact-prefix-names" : {
+ "description" : "Template , Resource Assignment Artifact Prefix names",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
}
- ],
- "default": "SQL"
- },
- "endpoint-selector": {
- "required": false,
- "type": "string"
- },
- "query": {
- "required": true,
- "type": "string"
- },
- "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"
- }
+ },
+ "request-id" : {
+ "description" : "Request Id, Unique Id for the request.",
+ "required" : true,
+ "type" : "string"
+ },
+ "resource-id" : {
+ "description" : "Resource Id.",
+ "required" : false,
+ "type" : "string"
+ },
+ "action-name" : {
+ "description" : "Action Name of the process",
+ "required" : false,
+ "type" : "string"
+ },
+ "dynamic-properties" : {
+ "description" : "Dynamic Json Content or DSL Json reference.",
+ "required" : false,
+ "type" : "json"
+ }
+ },
+ "outputs" : {
+ "resource-assignment-params" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "resource-assignment-map" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "status" : {
+ "required" : true,
+ "type" : "string"
+ }
+ }
}
- },
- "derived_from": "tosca.nodes.ResourceSource"
+ }
+ }
},
- "source-default": {
- "description": "This is Default Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
+ "derived_from" : "tosca.nodes.Component"
+ },
+ "source-capability" : {
+ "description" : "This is Component Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : {
+ "script-type" : {
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "kotlin", "internal", "jython" ]
+ } ],
+ "default" : "kotlin"
+ },
+ "script-class-reference" : {
+ "description" : "Capability reference name for internal and kotlin, for jython script file path",
+ "required" : true,
+ "type" : "string"
+ },
+ "instance-dependencies" : {
+ "description" : "Instance dependency Names to Inject to Kotlin / Jython Script.",
+ "required" : false,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ },
+ "key-dependencies" : {
+ "description" : "Resource Resolution dependency dictionary names.",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ }
},
- "source-input": {
- "description": "This is Input Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
+ "derived_from" : "tosca.nodes.ResourceSource"
+ },
+ "source-db" : {
+ "description" : "This is Database Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : {
+ "type" : {
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "SQL", "PLSQL" ]
+ } ],
+ "default" : "SQL"
+ },
+ "endpoint-selector" : {
+ "required" : false,
+ "type" : "string"
+ },
+ "query" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "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"
+ }
+ }
},
- "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"
- }
+ "derived_from" : "tosca.nodes.ResourceSource"
+ },
+ "source-default" : {
+ "description" : "This is Default Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : { },
+ "derived_from" : "tosca.nodes.ResourceSource"
+ },
+ "source-input" : {
+ "description" : "This is Input Resource Source Node Type",
+ "version" : "1.0.0",
+ "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",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "tosca.nodes.ResourceSource" : {
+ "description" : "TOSCA base type for Resource Sources",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "tosca.nodes.Vnf" : {
+ "description" : "This is VNF Node Type",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "vnf-netconf-device" : {
+ "description" : "This is VNF Device with Netconf Capability",
+ "version" : "1.0.0",
+ "capabilities" : {
+ "netconf" : {
+ "type" : "tosca.capabilities.Netconf",
+ "properties" : {
+ "login-key" : {
+ "required" : true,
+ "type" : "string",
+ "default" : "sdnc"
},
- "verb": {
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "GET",
- "POST",
- "DELETE",
- "PUT"
- ]
- }
- ],
- "default": "GET"
+ "login-account" : {
+ "required" : true,
+ "type" : "string",
+ "default" : "sdnc-tacacs"
},
- "payload": {
- "required": false,
- "type": "string",
- "default": ""
+ "source" : {
+ "required" : false,
+ "type" : "string",
+ "default" : "npm"
},
- "endpoint-selector": {
- "required": false,
- "type": "string"
+ "target-ip-address" : {
+ "required" : true,
+ "type" : "string"
},
- "url-path": {
- "required": true,
- "type": "string"
+ "port-number" : {
+ "required" : true,
+ "type" : "integer",
+ "default" : 830
},
- "path": {
- "required": true,
- "type": "string"
+ "connection-time-out" : {
+ "required" : false,
+ "type" : "integer",
+ "default" : 30
+ }
+ }
+ },
+ "restconf" : {
+ "type" : "tosca.capabilities.Restconf",
+ "properties" : {
+ "login-key" : {
+ "required" : true,
+ "type" : "string"
},
- "expression-type": {
- "required": false,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "JSON_PATH",
- "JSON_POINTER"
- ]
- }
- ],
- "default": "JSON_PATH"
+ "login-account" : {
+ "required" : true,
+ "type" : "string"
},
- "input-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
+ "target-ip-address" : {
+ "required" : true,
+ "type" : "string"
},
- "output-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
+ "port-number" : {
+ "required" : true,
+ "type" : "integer"
},
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
+ "connection-time-out" : {
+ "required" : false,
+ "type" : "integer",
+ "default" : 30
}
- },
- "derived_from": "tosca.nodes.ResourceSource"
- },
- "tosca.nodes.Component": {
- "description": "This is default Component Node",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
- },
- "tosca.nodes.ResourceSource": {
- "description": "TOSCA base type for Resource Sources",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
- },
- "tosca.nodes.Vnf": {
- "description": "This is VNF Node Type",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
+ }
+ }
},
- "vnf-netconf-device": {
- "description": "This is VNF Device with Netconf Capability",
- "version": "1.0.0",
- "capabilities": {
- "netconf": {
- "type": "tosca.capabilities.Netconf",
- "properties": {
- "login-key": {
- "required": true,
- "type": "string",
- "default": "sdnc"
- },
- "login-account": {
- "required": true,
- "type": "string",
- "default": "sdnc-tacacs"
- },
- "source": {
- "required": false,
- "type": "string",
- "default": "npm"
- },
- "target-ip-address": {
- "required": true,
- "type": "string"
- },
- "port-number": {
- "required": true,
- "type": "integer",
- "default": 830
- },
- "connection-time-out": {
- "required": false,
- "type": "integer",
- "default": 30
- }
- }
- },
- "restconf": {
- "type": "tosca.capabilities.Netconf",
- "properties": {
- "login-key": {
- "required": true,
- "type": "string",
- "default": "sdnc"
- },
- "login-account": {
- "required": true,
- "type": "string",
- "default": "sdnc-tacacs"
- },
- "source": {
- "required": false,
- "type": "string",
- "default": "npm"
- },
- "target-ip-address": {
- "required": true,
- "type": "string"
- },
- "port-number": {
- "required": true,
- "type": "integer",
- "default": 830
- },
- "connection-time-out": {
- "required": false,
- "type": "integer",
- "default": 30
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Vnf"
- }
- }
+ "derived_from" : "tosca.nodes.Vnf"
+ }
+ }
}
\ No newline at end of file
{
- "relationship_types" : { }
+ "relationship_types" : {
+ "tosca.relationships.ConnectsTo" : {
+ "description" : "Relationship tosca.relationships.ConnectsTo",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.relationships.Root"
+ }
+ }
}
\ No newline at end of file
{
- "aic-cloud-region": {
- "tags": "aic-cloud-region",
- "name": "aic-cloud-region",
- "property": {
- "description": "aic-cloud-region",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input",
- "properties": {}
- }
- }
- },
- "vlb_0_int_pktgen_private_port_0_mac": {
- "tags": "vlb_0_int_pktgen_private_port_0_mac",
- "name": "vlb_0_int_pktgen_private_port_0_mac",
- "property": {
- "description": "vlb_0_int_pktgen_private_port_0_mac",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_0_int_pktgen_private_port_0_mac",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_0_int_pktgen_private_port_0_mac": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "vpg_0_int_pktgen_private_port_0_mac": {
- "tags": "vpg_0_int_pktgen_private_port_0_mac",
- "name": "vpg_0_int_pktgen_private_port_0_mac",
- "property": {
- "description": "vpg_0_int_pktgen_private_port_0_mac",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_0_int_pktgen_private_port_0_mac",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_0_int_pktgen_private_port_0_mac": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "cloud_env": {
- "tags": "cloud_env",
- "name": "cloud_env",
- "property": {
- "description": "cloud_env",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/cloud_env",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "cloud_env": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "create-md-sal-vnf-param": {
- "tags": "create-md-sal-vnf-param",
- "name": "create-md-sal-vnf-param",
- "property": {
- "description": "create-md-sal-vnf-param",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "verb": "PUT",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
- "path": "",
- "payload": "{\n\"GENERIC-RESOURCE-API:param\": [\n{\n\"GENERIC-RESOURCE-API:name\": \"vdns_vf_module_id\",\n\"GENERIC-RESOURCE-API:value\": \"$vf-module-id\"\n}\n]\n}",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id",
- "vf-module-id": "vf-module-id"
- },
- "output-key-mapping": {},
- "key-dependencies": [
- "vf-module-id",
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "aai-data": {
- "type": "source-rest",
- "properties": {
- "verb": "PATCH",
- "type": "JSON",
- "url-path": "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/nm-profile-name",
- "payload": "{\"nm-profile-name\":\"$vf-module-id\"}",
- "path": "",
- "input-key-mapping": {
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {},
- "key-dependencies": [
- "vnf-id"
- ]
- }
- }
- }
- },
- "dcae_collector_ip": {
- "tags": "dcae_collector_ip",
- "name": "dcae_collector_ip",
- "property": {
- "description": "dcae_collector_ip",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_ip",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "dcae_collector_ip": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "dcae_collector_port": {
- "tags": "dcae_collector_port",
- "name": "dcae_collector_port",
- "property": {
- "description": "dcae_collector_port",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_port",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "dcae_collector_port": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "demo_artifacts_version": {
- "tags": "demo_artifacts_version",
- "name": "demo_artifacts_version",
- "property": {
- "description": "demo_artifacts_version",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/demo_artifacts_version",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "demo_artifacts_version": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "flavor_name": {
- "tags": "flavor_name",
- "name": "flavor_name",
- "property": {
- "description": "flavor_name",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/flavor_name",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "flavor_name": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "gre_ipaddr": {
- "tags": "gre_ipaddr",
- "name": "gre_ipaddr",
- "property": {
- "description": "gre_ipaddr",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/gre_ipaddr",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "gre_ipaddr": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private1-prefix-id"
- },
- "output-key-mapping": {
- "gre_ipaddr": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private1-prefix-id"
- ]
- }
- }
- }
- },
- "image_name": {
- "tags": "image_name",
- "name": "image_name",
- "property": {
- "description": "image_name",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/image_name",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "image_name": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "install_script_version": {
- "tags": "install_script_version",
- "name": "install_script_version",
- "property": {
- "description": "install_script_version",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/install_script_version",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "install_script_version": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "int_pktgen_private_net_id": {
- "tags": "int_pktgen_private_net_id",
- "name": "int_pktgen_private_net_id",
- "property": {
- "description": "int_pktgen_private_net_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_net_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "int_pktgen_private_net_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "int_pktgen_private_subnet_id": {
- "tags": "int_pktgen_private_subnet_id",
- "name": "int_pktgen_private_subnet_id",
- "property": {
- "description": "int_pktgen_private_subnet_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_subnet_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "int_pktgen_private_subnet_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "int_private_net_id": {
- "tags": "int_private_net_id",
- "name": "int_private_net_id",
- "property": {
- "description": "int_private_net_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_net_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "int_private_net_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "int_private_subnet_id": {
- "tags": "int_private_subnet_id",
- "name": "int_private_subnet_id",
- "property": {
- "description": "int_private_subnet_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_subnet_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "int_private_subnet_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "key_name": {
- "tags": "key_name",
- "name": "key_name",
- "property": {
- "description": "key_name",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/key_name",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "key_name": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "keypair": {
- "tags": "keypair",
- "name": "keypair",
- "property": {
- "description": "keypair",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/keypair",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "keypair": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "management-prefix-id": {
- "tags": "management-prefix-id",
- "name": "management-prefix-id",
- "property": {
- "description": "management-prefix-id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/management-prefix-id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "management-prefix-id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"management\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "management-prefix-id": "prefix_id"
- }
- }
- }
- }
- },
- "nb_api_version": {
- "tags": "nb_api_version",
- "name": "nb_api_version",
- "property": {
- "description": "nb_api_version",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nb_api_version",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "nb_api_version": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "nexus_artifact_repo": {
- "tags": "nexus_artifact_repo",
- "name": "nexus_artifact_repo",
- "property": {
- "description": "nexus_artifact_repo",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nexus_artifact_repo",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "nexus_artifact_repo": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "nfc-naming-code": {
- "tags": "nfc-naming-code",
- "name": "nfc-naming-code",
- "property": {
- "description": "nfc-naming-code",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",
- "input-key-mapping": {
- "vfccustomizationuuid": "vfccustomizationuuid"
- },
- "output-key-mapping": {
- "nfc-naming-code": "nfc_naming_code"
- },
- "key-dependencies": [
- "vfccustomizationuuid"
- ]
- }
- }
- }
- },
- "onap_private_net_cidr": {
- "tags": "onap_private_net_cidr",
- "name": "onap_private_net_cidr",
- "property": {
- "description": "onap_private_net_cidr",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"management\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "onap_private_net_cidr": "prefix"
- }
- }
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_cidr",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "onap_private_net_cidr": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "onap_private_net_id": {
- "tags": "onap_private_net_id",
- "name": "onap_private_net_id",
- "property": {
- "description": "onap_private_net_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "onap_private_net_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "onap_private_subnet_id": {
- "tags": "onap_private_subnet_id",
- "name": "onap_private_subnet_id",
- "property": {
- "description": "onap_private_subnet_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_subnet_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "onap_private_subnet_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "pg_int": {
- "tags": "pg_int",
- "name": "pg_int",
- "property": {
- "description": "pg_int",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pg_int",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "pg_int": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private2-prefix-id"
- },
- "output-key-mapping": {
- "pg_int": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private2-prefix-id"
- ]
- }
- }
- }
- },
- "pktgen_private_net_cidr": {
- "tags": "pktgen_private_net_cidr",
- "name": "pktgen_private_net_cidr",
- "property": {
- "description": "pktgen_private_net_cidr",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private2\"",
- "output-key-mapping": {
- "pktgen_private_net_cidr": "prefix"
- },
- "input-key-mapping": {}
- }
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pktgen_private_net_cidr",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "pktgen_private_net_cidr": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "private1-prefix-id": {
- "tags": "private1-prefix-id",
- "name": "private1-prefix-id",
- "property": {
- "description": "private1-prefix-id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private1-prefix-id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "private1-prefix-id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private1\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "private1-prefix-id": "prefix_id"
- }
- }
- }
- }
- },
- "private2-prefix-id": {
- "tags": "private2-prefix-id",
- "name": "private2-prefix-id",
- "property": {
- "description": "private2-prefix-id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private2-prefix-id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "private2-prefix-id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private2\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "private2-prefix-id": "prefix_id"
- }
- }
- }
- }
- },
- "pub_key": {
- "tags": "pub_key",
- "name": "pub_key",
- "property": {
- "description": "pub_key",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pub_key",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "pub_key": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "public_net_id": {
- "tags": "public_net_id",
- "name": "public_net_id",
- "property": {
- "description": "public_net_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/public_net_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "public_net_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "sec_group": {
- "tags": "sec_group",
- "name": "sec_group",
- "property": {
- "description": "sec_group",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/sec_group",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "sec_group": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "service-instance-id": {
- "tags": "service-instance-id, tosca.datatypes.Root, data_type",
- "name": "service-instance-id",
- "property": {
- "description": "To be provided",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input",
- "properties": {}
- },
- "any-db": {
- "type": "source-db",
- "properties": {
- "query": "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "service-instance-id": "artifact_name"
- }
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "query": "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "service-instance-id": "artifact_name"
- }
- }
- },
- "capability": {
- "type": "source-capability",
- "properties": {
- "script-type": "jython",
- "script-class-reference": "SampleRAProcessor",
- "instance-key-dependencies": []
- }
- }
- }
- },
- "vdns_int_private_ip_0": {
- "tags": "vdns_int_private_ip_0",
- "name": "vdns_int_private_ip_0",
- "property": {
- "description": "vdns_int_private_ip_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_int_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id",
- "vdns_vf_module_id": "vdns_vf_module_id"
- },
- "output-key-mapping": {
- "vdns_int_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id",
- "vdns_vf_module_id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private1-prefix-id"
- },
- "output-key-mapping": {
- "vdns_int_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private1-prefix-id"
- ]
- }
- }
- }
- },
- "vdns_name_0": {
- "tags": "vdns_name_0",
- "name": "vdns_name_0",
- "property": {
- "description": "vdns_name_0",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_name_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vdns_name_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "naming-resolution",
- "verb": "POST",
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "url-path": "/v1/genNetworkElementName",
- "payload": "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vdns_name_0\",\r\n\t\t\"resource-value\": \"${vdns_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vdns_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
- "path": "/elements/0/resource-value",
- "input-key-mapping": {
- "vf-naming-policy": "vf-naming-policy",
- "nfc-naming-code": "nfc-naming-code",
- "vnf_name": "vnf_name",
- "vf-module-id": "vf-module-id"
-
- },
- "output-key-mapping": {
- "vdns_name_0": "resource-value"
- },
- "key-dependencies": [
- "vf-naming-policy",
- "nfc-naming-code",
- "vnf_name",
- "vf-module-id"
-
- ]
- }
- }
- }
- },
- "vdns_onap_private_ip_0": {
- "tags": "vdns_onap_private_ip_0",
- "name": "vdns_onap_private_ip_0",
- "property": {
- "description": "vdns_onap_private_ip_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_onap_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id",
- "vdns_vf_module_id": "vdns_vf_module_id"
- },
- "output-key-mapping": {
- "vdns_onap_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id",
- "vdns_vf_module_id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "management-prefix-id"
- },
- "output-key-mapping": {
- "vdns_onap_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "management-prefix-id"
- ]
- }
- }
- }
- },
- "vdns_vf_module_id": {
- "tags": "vdns_vf_module_id",
- "name": "vdns_vf_module_id",
- "property": {
- "description": "vdns_vf_module_id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vdns_vf_module_id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",
- "path": "",
- "input-key-mapping": {
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vdns_vf_module_id": "nm-profile-name"
- },
- "key-dependencies": [
- "vnf-id"
- ]
- }
- }
- }
- },
- "vf-module-id": {
- "tags": "vf-module-id",
- "name": "vf-module-id",
- "property": {
- "description": "vf-module-id",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input",
- "properties": {}
- }
- }
- },
- "vf-module-label": {
- "tags": "vf-module-label",
- "name": "vf-module-label",
- "property": {
- "description": "vf-module-label",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
- "input-key-mapping": {
- "customizationid": "vf-module-model-customization-uuid"
- },
- "output-key-mapping": {
- "vf-module-label": "vf_module_label"
- },
- "key-dependencies": [
- "vf-module-model-customization-uuid"
- ]
- }
- }
- }
- },
- "vf-module-model-customization-uuid": {
- "tags": "vf-module-model-customization-uuid",
- "name": "vf-module-model-customization-uuid",
- "property": {
- "description": "vf-module-model-customization-uuid",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- }
- }
- },
- "vnf_assign_aai": {
-
- "tags": "vnf_assign_aai",
- "name": "vnf_assign_aai",
- "property": {
- "description": "vnf_assign_aai",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "aai-data": {
- "type": "source-rest",
- "properties": {
- "verb": "PATCH",
- "type": "JSON",
- "headers": {
-
- "Content-Type": "application/merge-patch+json"
-
- },
- "url-path": "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",
- "payload": "{\r\n\"vnf-name\":\"${vnf_name}\", \r\n \"selflink\": \"restconf\/config\/GENERIC-RESOURCE-API:services\/service\/${service-instance-id}\/service-data\/vnfs\/vnf\/${vnf-id}\/vnf-data\/vnf-topology\/\"\r\n}",
- "path": "",
- "input-key-mapping": {
- "service-instance-id":"service-instance-id",
- "vnf-id": "vnf-id",
- "vnf_name": "vnf_name"
- },
- "output-key-mapping": {},
- "key-dependencies": [
- "service-instance-id",
- "vnf-id",
- "vnf_name"
- ]
- }
- }
- }
- },
-
- "vf-module-assign": {
-
- "tags": "vf-module-assign",
- "name": "vf-module-assign",
- "property": {
- "description": "vf-module-assign",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
-
- "aai-data": {
- "type": "source-rest",
- "properties": {
- "verb": "PATCH",
- "type": "JSON",
- "headers": {
-
- "Content-Type": "application/merge-patch+json"
-
- },
- "url-path": "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/vf-modules/vf-module/$vf-module-id",
- "payload": "{\r\n\"vf-module-name\":\"${vf-module-name}\", \r\n\"selflink\": \"restconf\/config\/GENERIC-RESOURCE-API:services\/service\/${service-instance-id}\/service-data\/vnfs\/vnf\/${vnf-id}\/vnf-data\/vf-modules\/vf-module\/${vf-module-id}\/vf-module-data\/vf-module-topology\/\"\r\n \r\n}",
- "path": "",
- "input-key-mapping": {
- "service-instance-id":"service-instance-id",
- "vnf-id": "vnf-id",
- "vf-module-id": "vf-module-id",
- "vf-module-name": "vf-module-name"
- },
- "output-key-mapping": {},
- "key-dependencies": [
- "service-instance-id",
- "vnf-id",
- "vf-module-id",
- "vf-module-name"
- ]
- }
- }
- }
- },
-
- "vf-module-name": {
- "tags": "vf-module-name",
- "name": "vf-module-name",
- "property": {
- "description": "vf_module_name",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vf-module-name",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vf-module-name": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id",
- "vf_module_id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "naming-resolution",
- "verb": "POST",
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "url-path": "/v1/genNetworkElementName",
- "payload": "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vf-module-name\",\r\n \"resource-value\": \"${vf-module-name}\",\r\n \"external-key\": \"${vf-module-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VF-MODULE\",\r\n \"VNF_NAME\": \"${vnf_name}\",\r\n \"VF_MODULE_LABEL\":\"${vf-module-label}\",\r\n \"VF_MODULE_TYPE\":\"${vf-module-type}\"\r\n }\r\n ]\r\n}",
- "path": "/elements/0/resource-value",
- "input-key-mapping": {
- "vf-naming-policy": "vf-naming-policy",
- "vnf_name": "vnf_name",
- "vf-module-label": "vf-module-label",
- "vf-module-type": "vf-module-type",
- "vf-module-id": "vf-module-id"
-
- },
- "output-key-mapping": {
- "vf-module-name": "resource-value"
- },
- "key-dependencies": [
- "vf-naming-policy",
- "vnf_name",
- "vf-module-label",
- "vf-module-type",
- "vf-module-id"
- ]
- }
- }
- }
- },
- "vf-module-type": {
- "tags": "vf-module-type",
- "name": "vf-module-type",
- "property": {
- "description": "vf-module-type",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",
- "output-key-mapping": {
- "vf-module-type": "vf_module_type"
- },
- "input-key-mapping": {
- "customizationid": "vf-module-model-customization-uuid"
- },
- "key-dependencies": [
- "vf-module-model-customization-uuid"
- ]
- }
- }
- }
- },
- "vf-naming-policy": {
- "tags": "vf-naming-policy",
- "name": "vf-naming-policy",
- "property": {
- "description": "vf-naming-policy",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vf-naming-policy",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vf-naming-policy": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",
- "input-key-mapping": {
- "vnf_model_customization_uuid": "vnf-model-customization-uuid"
- },
- "output-key-mapping": {
- "vf-naming-policy": "vf_naming_policy"
- },
- "key-dependencies": [
- "vnf-model-customization-uuid"
- ]
- }
- }
- }
- },
- "vfccustomizationuuid": {
- "tags": "vfccustomizationuuid",
- "name": "vfccustomizationuuid",
- "property": {
- "description": "vfccustomizationuuid",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",
- "input-key-mapping": {
- "vfmodulecustomizationuuid": "vf-module-model-customization-uuid"
- },
- "output-key-mapping": {
- "vfccustomizationuuid": "vnf_customid"
- },
- "key-dependencies": [
- "vf-module-model-customization-uuid"
- ]
- }
- }
- }
- },
- "vip": {
- "tags": "vip",
- "name": "vip",
- "property": {
- "description": "vip",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vip",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vip": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private2-prefix-id"
- },
- "output-key-mapping": {
- "vip": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private2-prefix-id"
- ]
- }
- }
- }
- },
- "vlb_int_pktgen_private_ip_0": {
- "tags": "vlb_int_pktgen_private_ip_0",
- "name": "vlb_int_pktgen_private_ip_0",
- "property": {
- "description": "vlb_int_pktgen_private_ip_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_pktgen_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_int_pktgen_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private2-prefix-id"
- },
- "output-key-mapping": {
- "vlb_int_pktgen_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private2-prefix-id"
- ]
- }
- }
- }
- },
- "vlb_int_private_ip_0": {
- "tags": "vlb_int_private_ip_0",
- "name": "vlb_int_private_ip_0",
- "property": {
- "description": "vlb_int_private_ip_0",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_int_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private1-prefix-id"
- },
- "output-key-mapping": {
- "vlb_int_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private1-prefix-id"
- ]
- }
- }
- }
- },
- "vlb_name_0": {
- "tags": "vlb_name_0",
- "name": "vlb_name_0",
- "property": {
- "description": "vlb_name_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_name_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_name_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "naming-resolution",
- "verb": "POST",
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "url-path": "/v1/genNetworkElementName",
- "payload": "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vlb_name_0\",\r\n\t\t\"resource-value\": \"${vlb_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vlb_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
- "path": "/elements/0/resource-value",
- "input-key-mapping": {
- "vf-naming-policy": "vf-naming-policy",
- "nfc-naming-code": "nfc-naming-code",
- "vnf_name": "vnf_name",
- "vf-module-id": "vf-module-id"
- },
- "output-key-mapping": {
- "vlb_name_0": "resource-value"
- },
- "key-dependencies": [
- "vf-naming-policy",
- "nfc-naming-code",
- "vnf_name",
- "vf-module-id"
- ]
- }
- }
- }
- },
- "vlb_onap_private_ip_0": {
- "tags": "vlb_onap_private_ip_0",
- "name": "vlb_onap_private_ip_0",
- "property": {
- "description": "vlb_onap_private_ip_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_onap_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_onap_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "management-prefix-id"
- },
- "output-key-mapping": {
- "vlb_onap_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "management-prefix-id"
- ]
- }
- }
- }
- },
- "vlb_private_net_cidr": {
- "tags": "vlb_private_net_cidr",
- "name": "vlb_private_net_cidr",
- "property": {
- "description": "vlb_private_net_cidr",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_private_net_cidr",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vlb_private_net_cidr": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private1\"",
- "input-key-mapping": {},
- "output-key-mapping": {
- "vlb_private_net_cidr": "prefix"
- }
- }
- }
- }
- },
- "vm-type": {
- "tags": "vm-type",
- "name": "vm-type",
- "property": {
- "description": "vm-type",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select VFC_MODEL.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
- "output-key-mapping": {
- "vm-type": "vm_type"
- },
- "input-key-mapping": {
- "vfccustomizationuuid": "vfccustomizationuuid"
- },
- "key-dependencies": [
- "vfccustomizationuuid"
- ]
- }
- }
- }
- },
- "vnf-id": {
- "tags": "vnf-id",
- "name": "vnf-id",
- "property": {
- "description": "vnf-id",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf-id",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vnf-id": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "vnf-model-customization-uuid": {
- "tags": "vnf-model-customization-uuid",
- "name": "vnf-model-customization-uuid",
- "property": {
- "description": "vnf-model-customization-uuid",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input",
- "properties": {}
- }
- }
- },
- "vnf_name": {
- "tags": "vnf_name",
- "name": "vnf_name",
- "property": {
- "description": "vnf_name",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name",
- "path": "/param/0/value",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vnf_name": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "naming-resolution",
- "verb": "POST",
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "url-path": "/v1/genNetworkElementName",
- "payload": "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vnf_name\",\r\n \"resource-value\": \"${vnf_name}\",\r\n \"external-key\": \"${vnf-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VNF\",\r\n \"AIC_CLOUD_REGION\": \"${aic-cloud-region}\"\r\n }\r\n ]\r\n}",
- "path": "/elements/0/resource-value",
- "input-key-mapping": {
- "vnf-id": "vnf-id",
- "aic-cloud-region": "aic-cloud-region",
- "vf-naming-policy": "vf-naming-policy"
- },
- "output-key-mapping": {
- "vnf_name": "resource-value"
- },
- "key-dependencies": [
- "vnf-id",
- "aic-cloud-region",
- "vf-naming-policy"
- ]
- }
- }
- }
- },
- "repo_url_blob": {
- "tags": "repo_url_blob",
- "name": "repo_url_blob",
- "property": {
- "description": "repo_url_blob",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/repo_url_blob",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "repo_url_blob": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "repo_url_artifacts": {
- "tags": "repo_url_artifacts",
- "name": "repo_url_artifacts",
- "property": {
- "description": "repo_url_artifacts",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/repo_url_artifacts",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "repo_url_artifacts": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
- },
- "vnfc-model-invariant-uuid": {
- "tags": "vnfc-model-invariant-uuid",
- "name": "vnfc-model-invariant-uuid",
- "property": {
- "description": "vnfc-model-invariant-uuid",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select VFC_MODEL.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
- "output-key-mapping": {
- "vnfc-model-invariant-uuid": "vfc_invariant_uuid"
- },
- "input-key-mapping": {
- "vfccustomizationuuid": "vfccustomizationuuid"
- },
- "key-dependencies": [
- "vfccustomizationuuid"
- ]
- }
- }
- }
- },
- "vnfc-model-version": {
- "tags": "vnfc-model-version",
- "name": "vnfc-model-version",
- "property": {
- "description": "vnfc-model-version",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "processor-db": {
- "type": "source-db",
- "properties": {
- "type": "SQL",
- "query": "select VFC_MODEL.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
- "output-key-mapping": {
- "vnfc-model-version": "vnfc_model_version"
- },
- "input-key-mapping": {
- "vfccustomizationuuid": "vfccustomizationuuid"
- },
- "key-dependencies": [
- "vfccustomizationuuid"
- ]
- }
- }
- }
- },
- "vpg_int_private1_ip_0": {
- "tags": "vpg_int_private1_ip_0",
- "name": "vpg_int_private1_ip_0",
- "property": {
- "description": "vpg_int_private1_ip_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_int_private1_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_int_private1_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "management-prefix-id"
- },
- "output-key-mapping": {
- "vpg_int_private1_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "management-prefix-id"
- ]
- }
- }
- }
- },
- "vpg_int_pktgen_private_ip_0": {
- "tags": "vpg_int_pktgen_private_ip_0",
- "name": "vpg_int_pktgen_private_ip_0",
- "property": {
- "description": "vpg_int_pktgen_private_ip_0",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_int_pktgen_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_int_pktgen_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "private2-prefix-id"
- },
- "output-key-mapping": {
- "vpg_int_pktgen_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "private2-prefix-id"
- ]
- }
- }
- }
- },
- "vpg_name_0": {
- "tags": "vpg_name_0",
- "name": "vpg_name_0",
- "property": {
- "description": "vlb_name_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_name_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_name_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "naming-resolution",
- "verb": "POST",
- "type": "JSON",
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json"
- },
- "url-path": "/v1/genNetworkElementName",
- "payload": "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vpg_name_0\",\r\n\t\t\"resource-value\": \"${vpg_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vpg_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
- "path": "/elements/0/resource-value",
- "input-key-mapping": {
- "vf-naming-policy": "vf-naming-policy",
- "nfc-naming-code": "nfc-naming-code",
- "vnf_name": "vnf_name",
- "vf-module-id": "vf-module-id"
-
- },
- "output-key-mapping": {
- "vpg_name_0": "resource-value"
- },
- "key-dependencies": [
- "vf-naming-policy",
- "nfc-naming-code",
- "vnf_name",
- "vf-module-id"
-
- ]
- }
- }
- }
- },
- "vpg_onap_private_ip_0": {
- "tags": "vpg_onap_private_ip_0",
- "name": "vpg_onap_private_ip_0",
- "property": {
- "description": "vpg_onap_private_ip_0",
- "type": "string"
- },
- "updated-by": "Singal, Kapil <ks220y@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_onap_private_ip_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_onap_private_ip_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- },
- "rest": {
- "type": "source-rest",
- "properties": {
- "endpoint-selector": "ipam-1",
- "type": "JSON",
- "verb": "POST",
- "url-path": "/api/ipam/prefixes/$prefix-id/available-ips/",
- "path": "",
- "input-key-mapping": {
- "prefix-id": "management-prefix-id"
- },
- "output-key-mapping": {
- "vpg_onap_private_ip_0": "address",
- "id": "id"
- },
- "key-dependencies": [
- "management-prefix-id"
- ]
- }
- }
- }
- }
-}
+ "aic-cloud-region" : {
+ "tags" : "aic-cloud-region",
+ "name" : "aic-cloud-region",
+ "property" : {
+ "description" : "aic-cloud-region",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "cloud_env" : {
+ "tags" : "cloud_env",
+ "name" : "cloud_env",
+ "property" : {
+ "description" : "cloud_env",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/cloud_env",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "cloud_env" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "create-md-sal-vnf-param" : {
+ "tags" : "create-md-sal-vnf-param",
+ "name" : "create-md-sal-vnf-param",
+ "property" : {
+ "description" : "create-md-sal-vnf-param",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "verb" : "PUT",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
+ "path" : "",
+ "payload" : "{\n\"GENERIC-RESOURCE-API:param\": [\n{\n\"GENERIC-RESOURCE-API:name\": \"vdns_vf_module_id\",\n\"GENERIC-RESOURCE-API:value\": \"$vf-module-id\"\n}\n]\n}",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "vf-module-id", "service-instance-id", "vnf-id" ]
+ }
+ },
+ "aai-data" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "PATCH",
+ "type" : "JSON",
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/nm-profile-name",
+ "payload" : "{\"nm-profile-name\":\"$vf-module-id\"}",
+ "path" : "",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "vnf-id" ]
+ }
+ }
+ }
+ },
+ "dcae_collector_ip" : {
+ "tags" : "dcae_collector_ip",
+ "name" : "dcae_collector_ip",
+ "property" : {
+ "description" : "dcae_collector_ip",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_ip",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "dcae_collector_ip" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "dcae_collector_port" : {
+ "tags" : "dcae_collector_port",
+ "name" : "dcae_collector_port",
+ "property" : {
+ "description" : "dcae_collector_port",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_port",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "dcae_collector_port" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "demo_artifacts_version" : {
+ "tags" : "demo_artifacts_version",
+ "name" : "demo_artifacts_version",
+ "property" : {
+ "description" : "demo_artifacts_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/demo_artifacts_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "demo_artifacts_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "flavor_name" : {
+ "tags" : "flavor_name",
+ "name" : "flavor_name",
+ "property" : {
+ "description" : "flavor_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/flavor_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "flavor_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "gre_ipaddr" : {
+ "tags" : "gre_ipaddr",
+ "name" : "gre_ipaddr",
+ "property" : {
+ "description" : "gre_ipaddr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/gre_ipaddr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "gre_ipaddr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "gre_ipaddr" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "image_name" : {
+ "tags" : "image_name",
+ "name" : "image_name",
+ "property" : {
+ "description" : "image_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/image_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "image_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "install_script_version" : {
+ "tags" : "install_script_version",
+ "name" : "install_script_version",
+ "property" : {
+ "description" : "install_script_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/install_script_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "install_script_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_pktgen_private_net_id" : {
+ "tags" : "int_pktgen_private_net_id",
+ "name" : "int_pktgen_private_net_id",
+ "property" : {
+ "description" : "int_pktgen_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_pktgen_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_pktgen_private_subnet_id" : {
+ "tags" : "int_pktgen_private_subnet_id",
+ "name" : "int_pktgen_private_subnet_id",
+ "property" : {
+ "description" : "int_pktgen_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_pktgen_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_private_net_id" : {
+ "tags" : "int_private_net_id",
+ "name" : "int_private_net_id",
+ "property" : {
+ "description" : "int_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_private_subnet_id" : {
+ "tags" : "int_private_subnet_id",
+ "name" : "int_private_subnet_id",
+ "property" : {
+ "description" : "int_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "key_name" : {
+ "tags" : "key_name",
+ "name" : "key_name",
+ "property" : {
+ "description" : "key_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/key_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "key_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "management-prefix-id" : {
+ "tags" : "management-prefix-id",
+ "name" : "management-prefix-id",
+ "property" : {
+ "description" : "management-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/management-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "management-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"management\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "management-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "nb_api_version" : {
+ "tags" : "nb_api_version",
+ "name" : "nb_api_version",
+ "property" : {
+ "description" : "nb_api_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nb_api_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "nb_api_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "nexus_artifact_repo" : {
+ "tags" : "nexus_artifact_repo",
+ "name" : "nexus_artifact_repo",
+ "property" : {
+ "description" : "nexus_artifact_repo",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nexus_artifact_repo",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "nexus_artifact_repo" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "nfc-naming-code" : {
+ "tags" : "nfc-naming-code",
+ "name" : "nfc-naming-code",
+ "property" : {
+ "description" : "nfc-naming-code",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "output-key-mapping" : {
+ "nfc-naming-code" : "nfc_naming_code"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "onap_private_net_cidr" : {
+ "tags" : "onap_private_net_cidr",
+ "name" : "onap_private_net_cidr",
+ "property" : {
+ "description" : "onap_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"management\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "onap_private_net_cidr" : "prefix"
+ }
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "onap_private_net_id" : {
+ "tags" : "onap_private_net_id",
+ "name" : "onap_private_net_id",
+ "property" : {
+ "description" : "onap_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "onap_private_subnet_id" : {
+ "tags" : "onap_private_subnet_id",
+ "name" : "onap_private_subnet_id",
+ "property" : {
+ "description" : "onap_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "pg_int" : {
+ "tags" : "pg_int",
+ "name" : "pg_int",
+ "property" : {
+ "description" : "pg_int",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pg_int",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pg_int" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "pg_int" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "pktgen_private_net_cidr" : {
+ "tags" : "pktgen_private_net_cidr",
+ "name" : "pktgen_private_net_cidr",
+ "property" : {
+ "description" : "pktgen_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private2\"",
+ "output-key-mapping" : {
+ "pktgen_private_net_cidr" : "prefix"
+ },
+ "input-key-mapping" : { }
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pktgen_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pktgen_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "pktgen_private_net_id" : {
+ "tags" : "pktgen_private_net_id",
+ "name" : "pktgen_private_net_id",
+ "property" : {
+ "description" : "pktgen_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pktgen_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pktgen_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "private1-prefix-id" : {
+ "tags" : "private1-prefix-id",
+ "name" : "private1-prefix-id",
+ "property" : {
+ "description" : "private1-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private1-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "private1-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private1\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "private1-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "private2-prefix-id" : {
+ "tags" : "private2-prefix-id",
+ "name" : "private2-prefix-id",
+ "property" : {
+ "description" : "private2-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private2-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "private2-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private2\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "private2-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "pub_key" : {
+ "tags" : "pub_key",
+ "name" : "pub_key",
+ "property" : {
+ "description" : "pub_key",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pub_key",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pub_key" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "public_net_id" : {
+ "tags" : "public_net_id",
+ "name" : "public_net_id",
+ "property" : {
+ "description" : "public_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/public_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "public_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "sec_group" : {
+ "tags" : "sec_group",
+ "name" : "sec_group",
+ "property" : {
+ "description" : "sec_group",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/sec_group",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "sec_group" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "service-instance-id" : {
+ "tags" : "service-instance-id, tosca.datatypes.Root, data_type",
+ "name" : "service-instance-id",
+ "property" : {
+ "description" : "To be provided",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ },
+ "any-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "service-instance-id" : "artifact_name"
+ }
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "service-instance-id" : "artifact_name"
+ }
+ }
+ },
+ "capability" : {
+ "type" : "source-capability",
+ "properties" : {
+ "script-type" : "jython",
+ "script-class-reference" : "SampleRAProcessor",
+ "instance-dependencies" : [ ]
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id",
+ "path" : "/service/0/service-instance-id",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance.service-instance-id"
+ },
+ "output-key-mapping" : {
+ "service-instance-id" : "service-instance-id"
+ },
+ "key-dependencies" : [ "service-instance.service-instance-id" ]
+ }
+ }
+ }
+ },
+ "vdns_int_private_ip_0" : {
+ "tags" : "vdns_int_private_ip_0",
+ "name" : "vdns_int_private_ip_0",
+ "property" : {
+ "description" : "vdns_int_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_int_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vdns_vf_module_id" : "vdns_vf_module_id"
+ },
+ "output-key-mapping" : {
+ "vdns_int_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vdns_name_0" : {
+ "tags" : "vdns_name_0",
+ "name" : "vdns_name_0",
+ "property" : {
+ "description" : "vdns_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vdns_name_0\",\r\n\t\t\"resource-value\": \"${vdns_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vdns_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vdns_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "tags" : "vdns_onap_private_ip_0",
+ "name" : "vdns_onap_private_ip_0",
+ "property" : {
+ "description" : "vdns_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vdns_vf_module_id" : "vdns_vf_module_id"
+ },
+ "output-key-mapping" : {
+ "vdns_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vdns_vf_module_id" : {
+ "tags" : "vdns_vf_module_id",
+ "name" : "vdns_vf_module_id",
+ "property" : {
+ "description" : "vdns_vf_module_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_vf_module_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",
+ "path" : "",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_vf_module_id" : "nm-profile-name"
+ },
+ "key-dependencies" : [ "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vf-module-assign" : {
+ "tags" : "vf-module-assign",
+ "name" : "vf-module-assign",
+ "property" : {
+ "description" : "vf-module-assign",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "aai-data" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "PATCH",
+ "type" : "JSON",
+ "headers" : {
+ "Content-Type" : "application/merge-patch+json"
+ },
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/vf-modules/vf-module/$vf-module-id",
+ "payload" : "{\r\n\"vf-module-name\":\"${vf-module-name}\", \r\n\"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/${service-instance-id}/service-data/vnfs/vnf/${vnf-id}/vnf-data/vf-modules/vf-module/${vf-module-id}/vf-module-data/vf-module-topology/\"\r\n \r\n}",
+ "path" : "",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vf-module-id" : "vf-module-id",
+ "vf-module-name" : "vf-module-name"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vf-module-id", "vf-module-name" ]
+ }
+ }
+ }
+ },
+ "vf-module-id" : {
+ "tags" : "vf-module-id",
+ "name" : "vf-module-id",
+ "property" : {
+ "description" : "vf-module-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "vf-module-label" : {
+ "tags" : "vf-module-label",
+ "name" : "vf-module-label",
+ "property" : {
+ "description" : "vf-module-label",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
+ "input-key-mapping" : {
+ "customizationid" : "vf-module-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vf-module-label" : "vf_module_label"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vf-module-model-customization-uuid" : {
+ "tags" : "vf-module-model-customization-uuid",
+ "name" : "vf-module-model-customization-uuid",
+ "property" : {
+ "description" : "vf-module-model-customization-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ }
+ }
+ },
+ "vf-module-name" : {
+ "tags" : "vf-module-name",
+ "name" : "vf-module-name",
+ "property" : {
+ "description" : "vf-module-name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vf-module-name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vf-module-name\",\r\n \"resource-value\": \"${vf-module-name}\",\r\n \"external-key\": \"${vf-module-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VF-MODULE\",\r\n \"VNF_NAME\": \"${vnf_name}\",\r\n \"VF_MODULE_LABEL\":\"${vf-module-label}\",\r\n \"VF_MODULE_TYPE\":\"${vf-module-type}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "vnf_name" : "vnf_name",
+ "vf-module-label" : "vf-module-label",
+ "vf-module-type" : "vf-module-type",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "vnf_name", "vf-module-label", "vf-module-type", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vf-module-type" : {
+ "tags" : "vf-module-type",
+ "name" : "vf-module-type",
+ "property" : {
+ "description" : "vf-module-type",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",
+ "output-key-mapping" : {
+ "vf-module-type" : "vf_module_type"
+ },
+ "input-key-mapping" : {
+ "customizationid" : "vf-module-model-customization-uuid"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vf-naming-policy" : {
+ "tags" : "vf-naming-policy",
+ "name" : "vf-naming-policy",
+ "property" : {
+ "description" : "vf-naming-policy",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vf-naming-policy",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vf-naming-policy" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",
+ "input-key-mapping" : {
+ "vnf_model_customization_uuid" : "vnf-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vf-naming-policy" : "vf_naming_policy"
+ },
+ "key-dependencies" : [ "vnf-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vfccustomizationuuid" : {
+ "tags" : "vfccustomizationuuid",
+ "name" : "vfccustomizationuuid",
+ "property" : {
+ "description" : "vfccustomizationuuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",
+ "input-key-mapping" : {
+ "vfmodulecustomizationuuid" : "vf-module-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vfccustomizationuuid" : "vnf_customid"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vip" : {
+ "tags" : "vip",
+ "name" : "vip",
+ "property" : {
+ "description" : "vip",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vip",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vip" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vip" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_0_int_pktgen_private_port_0_mac" : {
+ "tags" : "vlb_0_int_pktgen_private_port_0_mac",
+ "name" : "vlb_0_int_pktgen_private_port_0_mac",
+ "property" : {
+ "description" : "vlb_0_int_pktgen_private_port_0_mac",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_0_int_pktgen_private_port_0_mac",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_0_int_pktgen_private_port_0_mac" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vlb_int_pktgen_private_ip_0" : {
+ "tags" : "vlb_int_pktgen_private_ip_0",
+ "name" : "vlb_int_pktgen_private_ip_0",
+ "property" : {
+ "description" : "vlb_int_pktgen_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_pktgen_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_pktgen_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_int_private_ip_0" : {
+ "tags" : "vlb_int_private_ip_0",
+ "name" : "vlb_int_private_ip_0",
+ "property" : {
+ "description" : "vlb_int_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_name_0" : {
+ "tags" : "vlb_name_0",
+ "name" : "vlb_name_0",
+ "property" : {
+ "description" : "vlb_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vlb_name_0\",\r\n\t\t\"resource-value\": \"${vlb_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vlb_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vlb_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vlb_onap_private_ip_0" : {
+ "tags" : "vlb_onap_private_ip_0",
+ "name" : "vlb_onap_private_ip_0",
+ "property" : {
+ "description" : "vlb_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_private_net_cidr" : {
+ "tags" : "vlb_private_net_cidr",
+ "name" : "vlb_private_net_cidr",
+ "property" : {
+ "description" : "vlb_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private1\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "vlb_private_net_cidr" : "prefix"
+ }
+ }
+ }
+ }
+ },
+ "vlb_private_net_id" : {
+ "tags" : "vlb_private_net_id",
+ "name" : "vlb_private_net_id",
+ "property" : {
+ "description" : "vlb_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vm-type" : {
+ "tags" : "vm-type",
+ "name" : "vm-type",
+ "property" : {
+ "description" : "vm-type",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vm-type" : "vm_type"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vnf-id" : {
+ "tags" : "vnf-id",
+ "name" : "vnf-id",
+ "property" : {
+ "description" : "vnf-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vnf-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vnf-model-customization-uuid" : {
+ "tags" : "vnf-model-customization-uuid",
+ "name" : "vnf-model-customization-uuid",
+ "property" : {
+ "description" : "vnf-model-customization-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "vnf_assign_aai" : {
+ "tags" : "vnf_assign_aai",
+ "name" : "vnf_assign_aai",
+ "property" : {
+ "description" : "vnf_assign_aai",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "aai-data" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "PATCH",
+ "type" : "JSON",
+ "headers" : {
+ "Content-Type" : "application/merge-patch+json"
+ },
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",
+ "payload" : "{\r\n\"vnf-name\":\"${vnf_name}\", \r\n \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/${service-instance-id}/service-data/vnfs/vnf/${vnf-id}/vnf-data/vnf-topology/\"\r\n}",
+ "path" : "",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vnf_name" : "vnf_name"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vnf_name" ]
+ }
+ }
+ }
+ },
+ "vnf_name" : {
+ "tags" : "vnf_name",
+ "name" : "vnf_name",
+ "property" : {
+ "description" : "vnf_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name",
+ "path" : "/param/0/value",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vnf_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vnf_name\",\r\n \"resource-value\": \"${vnf_name}\",\r\n \"external-key\": \"${vnf-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VNF\",\r\n \"AIC_CLOUD_REGION\": \"${aic-cloud-region}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id",
+ "aic-cloud-region" : "aic-cloud-region",
+ "vf-naming-policy" : "vf-naming-policy"
+ },
+ "output-key-mapping" : {
+ "vnf_name" : "resource-value"
+ },
+ "key-dependencies" : [ "vnf-id", "aic-cloud-region", "vf-naming-policy" ]
+ }
+ }
+ }
+ },
+ "vnfc-model-invariant-uuid" : {
+ "tags" : "vnfc-model-invariant-uuid",
+ "name" : "vnfc-model-invariant-uuid",
+ "property" : {
+ "description" : "vnfc-model-invariant-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vnfc-model-invariant-uuid" : "vfc_invariant_uuid"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vnfc-model-version" : {
+ "tags" : "vnfc-model-version",
+ "name" : "vnfc-model-version",
+ "property" : {
+ "description" : "vnfc-model-version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vnfc-model-version" : "vnfc_model_version"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vpg_0_int_pktgen_private_port_0_mac" : {
+ "tags" : "vpg_0_int_pktgen_private_port_0_mac",
+ "name" : "vpg_0_int_pktgen_private_port_0_mac",
+ "property" : {
+ "description" : "vpg_0_int_pktgen_private_port_0_mac",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_0_int_pktgen_private_port_0_mac",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_0_int_pktgen_private_port_0_mac" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vpg_int_pktgen_private_ip_0" : {
+ "tags" : "vpg_int_pktgen_private_ip_0",
+ "name" : "vpg_int_pktgen_private_ip_0",
+ "property" : {
+ "description" : "vpg_int_pktgen_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_int_pktgen_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_int_pktgen_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vpg_name_0" : {
+ "tags" : "vpg_name_0",
+ "name" : "vpg_name_0",
+ "property" : {
+ "description" : "vlb_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vpg_name_0\",\r\n\t\t\"resource-value\": \"${vpg_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vpg_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vpg_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vpg_onap_private_ip_0" : {
+ "tags" : "vpg_onap_private_ip_0",
+ "name" : "vpg_onap_private_ip_0",
+ "property" : {
+ "description" : "vpg_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
"response-data"
]
}
- },
- "status": {
- "description": "Status of the Component Execution ( success or failure )",
- "required": true,
- "type": "string"
}
}
},
}
},
"execute": {
- "type": "component-script-executor",
+ "type": "component-netconf-executor",
"requirements": {
- "restconf-connection": {
+ "netconf-connection": {
"capability": "restconf",
"node": "netconf-device",
"relationship": "tosca.relationships.ConnectsTo"
}
},
"interfaces": {
- "ComponentScriptExecutor": {
+ "ComponentNetconfExecutor": {
"operations": {
"process": {
"inputs": {
}
},
"executeHealthCheck": {
- "type": "component-script-executor",
+ "type": "component-netconf-executor",
"requirements": {
- "restconf-connection": {
+ "netconf-connection": {
"capability": "restconf",
"node": "netconf-device",
"relationship": "tosca.relationships.ConnectsTo"
}
},
"interfaces": {
- "ComponentScriptExecutor": {
+ "ComponentNetconfExecutor": {
"operations": {
"process": {
"inputs": {
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput\r
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties\r
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction\r
import org.springframework.web.client.RestTemplate\r
import com.fasterxml.jackson.annotation.JsonIgnore\r
import com.fasterxml.jackson.annotation.JsonProperty\r
-import org.apache.http.client.ClientProtocolException\r
-import java.io.IOException\r
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException\r
\r
open class ConfigDeploy : AbstractScriptComponentFunction() {\r
val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode\r
val vdns_ip: String = payloadObject.get("vdns-instance")[0].get("ip-addr").asText()\r
\r
-\r
val blueprintContext = bluePrintRuntimeService.bluePrintContext()\r
- val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "restconf-connection")\r
+ val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "netconf-connection")\r
val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(requirement.node!!, requirement.capability!!)\r
val netconfDeviceInfo = JacksonUtils.getInstanceFromMap(capabilityProperties, NetconfDeviceInfo::class.java)\r
log.info("Waiting for 2 minutes until vLB intializes ...")\r
- //Thread.sleep(120000)\r
- val uri = "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances/vdns-instance/$vdns_ip"\r
+ // Thread.sleep(120000)\r
+ val uri =\r
+ "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances/vdns-instance/$vdns_ip"\r
val restTemplate = RestTemplate()\r
val mapOfHeaders = hashMapOf<String, String>()\r
mapOfHeaders.put("Accept", "application/json")\r
basicAuthRestClientProperties.username = "admin"\r
basicAuthRestClientProperties.password = "admin"\r
basicAuthRestClientProperties.url = uri\r
- basicAuthRestClientProperties.additionalHeaders =mapOfHeaders\r
- val basicAuthRestClientService: BasicAuthRestClientService= BasicAuthRestClientService(basicAuthRestClientProperties)\r
+ basicAuthRestClientProperties.additionalHeaders = mapOfHeaders\r
+ val basicAuthRestClientService: BasicAuthRestClientService = BasicAuthRestClientService(basicAuthRestClientProperties)\r
try {\r
- val result: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.PUT.name, "", payload)\r
+ val result: BlueprintWebClientService.WebClientResponse<String> =\r
+ basicAuthRestClientService.exchangeResource(HttpMethod.PUT.name, "", payload)\r
print(result)\r
- basicAuthRestClientProperties.url = "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
- val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
+ basicAuthRestClientProperties.url =\r
+ "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
+ val resultOfGet: BlueprintWebClientService.WebClientResponse<String> =\r
+ basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
print(resultOfGet)\r
- }\r
- catch (e: Exception) {\r
+ } catch (e: Exception) {\r
log.info("Caught exception trying to connect to vLB!!")\r
throw BluePrintProcessorException("${e.message}")\r
}\r
}\r
\r
class NetconfDeviceInfo {\r
+\r
@get:JsonProperty("login-account")\r
var username: String? = null\r
+\r
@get:JsonProperty("login-key")\r
var password: String? = null\r
+\r
@get:JsonProperty("target-ip-address")\r
var ipAddress: String? = null\r
+\r
@get:JsonProperty("port-number")\r
var port: Int = 0\r
+\r
@get:JsonProperty("connection-time-out")\r
var connectTimeout: Long = 5\r
+\r
@get:JsonIgnore\r
var source: String? = null\r
+\r
@get:JsonIgnore\r
var replyTimeout: Int = 5\r
+\r
@get:JsonIgnore\r
var idleTimeout: Int = 99999\r
\r
override fun toString(): String {\r
return "$ipAddress:$port"\r
}\r
- //TODO: should this be a data class instead? Is anything using the JSON serdes?\r
+\r
+ // TODO: should this be a data class instead? Is anything using the JSON serdes?\r
override fun equals(other: Any?): Boolean {\r
if (this === other) return true\r
if (javaClass != other?.javaClass) return false\r
override fun hashCode(): Int {\r
return javaClass.hashCode()\r
}\r
-}
\ No newline at end of file
+}\r
* limitations under the License.\r
*/\r
\r
-\r
import com.fasterxml.jackson.databind.node.ObjectNode\r
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput\r
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties\r
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction\r
import org.springframework.web.client.RestTemplate\r
import com.fasterxml.jackson.annotation.JsonIgnore\r
import com.fasterxml.jackson.annotation.JsonProperty\r
-import org.apache.http.client.ClientProtocolException\r
-import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils\r
-import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentRemoteScriptExecutor\r
-import java.io.IOException\r
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException\r
\r
open class HealthCheck : AbstractScriptComponentFunction() {\r
val resolution_key = getDynamicProperties("resolution-key").asText()\r
log.info("resolution_key: $resolution_key")\r
\r
- //val payload = storedContentFromResolvedArtifactNB(resolution_key, "baseconfig")\r
- //log.info("configuration: $payload")\r
-\r
- //val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode\r
- //val vdns_ip: String = payloadObject.get("vdns-instance")[0].get("ip-addr").asText()\r
+ // val payload = storedContentFromResolvedArtifactNB(resolution_key, "baseconfig")\r
+ // log.info("configuration: $payload")\r
\r
+ // val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode\r
+ // val vdns_ip: String = payloadObject.get("vdns-instance")[0].get("ip-addr").asText()\r
\r
val blueprintContext = bluePrintRuntimeService.bluePrintContext()\r
- val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "restconf-connection")\r
+ val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "netconf-connection")\r
val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(requirement.node!!, requirement.capability!!)\r
val netconfDeviceInfo = JacksonUtils.getInstanceFromMap(capabilityProperties, NetconfDeviceInfo2::class.java)\r
- //log.info("Waiting for 2 minutes until vLB intializes ...")\r
- //Thread.sleep(120000)\r
+ // log.info("Waiting for 2 minutes until vLB intializes ...")\r
+ // Thread.sleep(120000)\r
val uri = "http://${netconfDeviceInfo.ipAddress}:8183/restconf/operational/health-vnf-onap-plugin:health-vnf-onap-plugin-state/health-check"\r
val restTemplate = RestTemplate()\r
val mapOfHeaders = hashMapOf<String, String>()\r
mapOfHeaders.put("Accept", "application/json")\r
mapOfHeaders.put("Content-Type", "application/json")\r
- //mapOfHeaders.put("cache-control", " no-cache")\r
- //mapOfHeaders.put("Accept", "application/json")\r
+ // mapOfHeaders.put("cache-control", " no-cache")\r
+ // mapOfHeaders.put("Accept", "application/json")\r
val basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties()\r
basicAuthRestClientProperties.username = "admin"\r
basicAuthRestClientProperties.password = "admin"\r
basicAuthRestClientProperties.url = uri\r
- basicAuthRestClientProperties.additionalHeaders =mapOfHeaders\r
- val basicAuthRestClientService: BasicAuthRestClientService= BasicAuthRestClientService(basicAuthRestClientProperties)\r
+ basicAuthRestClientProperties.additionalHeaders = mapOfHeaders\r
+ val basicAuthRestClientService: BasicAuthRestClientService = BasicAuthRestClientService(basicAuthRestClientProperties)\r
try {\r
val result: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
log.info(result.body)\r
val resultJson = JacksonUtils.jsonNode(result.body) as ObjectNode\r
val health: String = resultJson.get("health-check").get("state").asText()\r
- super.setAttribute("response-data", resultJson) \r
+ super.setAttribute("response-data", resultJson)\r
if (health != "healthy") {\r
throw Exception("VNF is not healty!!")\r
}\r
- \r
- //basicAuthRestClientProperties.url = //"http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
- //val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
- //print(resultOfGet)\r
- }\r
- catch (e: Exception) {\r
+\r
+ // basicAuthRestClientProperties.url = //"http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
+ // val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
+ // print(resultOfGet)\r
+ } catch (e: Exception) {\r
log.info("Caught exception trying to connect to vLB!!")\r
throw BluePrintProcessorException("${e.message}")\r
}\r
}\r
\r
class NetconfDeviceInfo2 {\r
+\r
@get:JsonProperty("login-account")\r
var username: String? = null\r
+\r
@get:JsonProperty("login-key")\r
var password: String? = null\r
+\r
@get:JsonProperty("target-ip-address")\r
var ipAddress: String? = null\r
+\r
@get:JsonProperty("port-number")\r
var port: Int = 0\r
+\r
@get:JsonProperty("connection-time-out")\r
var connectTimeout: Long = 5\r
+\r
@get:JsonIgnore\r
var source: String? = null\r
+\r
@get:JsonIgnore\r
var replyTimeout: Int = 5\r
+\r
@get:JsonIgnore\r
var idleTimeout: Int = 99999\r
\r
override fun toString(): String {\r
return "$ipAddress:$port"\r
}\r
- //TODO: should this be a data class instead? Is anything using the JSON serdes?\r
+\r
+ // TODO: should this be a data class instead? Is anything using the JSON serdes?\r
override fun equals(other: Any?): Boolean {\r
if (this === other) return true\r
if (javaClass != other?.javaClass) return false\r
override fun hashCode(): Int {\r
return javaClass.hashCode()\r
}\r
-}
\ No newline at end of file
+}\r
-{\r
- "artifact_types" : {\r
- "artifact-directed-graph" : {\r
- "description" : "Directed Graph File",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.artifacts.Implementation",\r
- "file_ext" : [ "json", "xml" ]\r
- },\r
- "artifact-mapping-resource" : {\r
- "description" : "Resource Mapping File used along with Configuration template",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.artifacts.Implementation",\r
- "file_ext" : [ "json" ]\r
- },\r
- "artifact-template-velocity" : {\r
- "description" : " Velocity Template used for Configuration",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.artifacts.Implementation",\r
- "file_ext" : [ "vtl" ]\r
- }\r
- }\r
+{
+ "artifact_types" : {
+ "artifact-directed-graph" : {
+ "description" : "Directed Graph File",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.artifacts.Implementation",
+ "file_ext" : [ "json", "xml" ]
+ },
+ "artifact-mapping-resource" : {
+ "description" : "Resource Mapping File used along with Configuration template",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.artifacts.Implementation",
+ "file_ext" : [ "json" ]
+ },
+ "artifact-template-velocity" : {
+ "description" : " Velocity Template used for Configuration",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.artifacts.Implementation",
+ "file_ext" : [ "vtl" ]
+ }
+ }
}
\ No newline at end of file
-{\r
- "data_types" : {\r
- "dt-config-assign-properties" : {\r
- "description" : "Dynamic DataType definition for workflow(config-assign).",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "vdns_int_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnf-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_vf_module_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "service-instance-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_onap_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.datatypes.Dynamic"\r
- },\r
- "dt-config-deploy-properties" : {\r
- "description" : "Dynamic DataType definition for workflow(config-deploy).",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "vdns_int_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnf-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_vf_module_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "service-instance-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_onap_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "ip" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.datatypes.Dynamic"\r
- },\r
- "dt-resource-assignment-properties" : {\r
- "description" : "Dynamic DataType definition for workflow(resource-assignment).",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "vlb_int_pktgen_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "private1-prefix-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnf-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_private_net_cidr" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_onap_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vdns_onap_private_ip_0}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_image_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "public_net_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "sec_group" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "nfc-naming-code" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnfc-model-invariant-uuid" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "nexus_artifact_repo" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "https://nexus.onap.org",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "onap_private_net_cidr" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vpg_onap_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_name_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vdns_name_0}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_int_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vdns_int_private_ip_0}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "image_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "flavor_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "dcae_collector_ip" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vpg_name_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vpg_name_0}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vip" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vip}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf-naming-policy" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "int_private_net_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${int_private_net_id}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vfccustomizationuuid" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "onap_private_net_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "demo_artifacts_version" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_int_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnf-model-customization-uuid" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "int_private_subnet_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${int_private_subnet_id}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "key_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_name_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vlb_name_0}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "install_script_version" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "int_pktgen_private_net_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${int_pktgen_private_net_id}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vm-type" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnf_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "keypair" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "vlb_key",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "onap_private_subnet_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "aic-cloud-region" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "gre_ipaddr" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${gre_ipaddr}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf-module-model-customization-uuid" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf_module_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${vf_module_name}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "pg_int" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${pg_int}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vpg_flavor_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf-module-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "dcae_collector_port" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "30227",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf-module-label" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_flavor_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "pktgen_private_net_cidr" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vpg_image_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "private2-prefix-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vdns_flavor_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "m1.medium",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vnfc-model-version" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "service-instance-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "nb_api_version" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "1.2.0",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vpg_int_pktgen_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vf-module-type" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "pub_key" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs84Cy8+qi/jvucay0BwFtOq3ian0ulTXFGxkZcZCR0N48j88pbHJaEqb9e25MAsrfH+7Etb9Kd5nbBThEL/i0AyHXnDsc80Oq0sqlLcfLo3SGSurkrNoRofHboJ5Hn+N9SlWN5FCQGbTx1w3rjqR4LasAI6XxH9xpXSFyyge6ysVXH0cYaZ8sg98nFZa1fPJR9L8COjZvF+EYudub2RC5HVyV/sx7bliNFo9JwQh6du1abG4G7ZDjTIcYwYp21iq52UzWU28RVcAyY6AQZJu2lHLdsr8fPvyeWZpC5EqGsxI1G609m9G/dURRKwYfez/f2ATzpn5QjEX7LrLWBM8r Generated-by-Nova",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "management-prefix-id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "int_pktgen_private_subnet_id" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "${int_pktgen_private_subnet_id}",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "create-md-sal-vnf-param" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_onap_private_ip_0" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "cloud_env" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "default" : "openstack",\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- },\r
- "vlb_image_name" : {\r
- "description" : "",\r
- "required" : false,\r
- "type" : "string",\r
- "status" : "",\r
- "constraints" : [ { } ],\r
- "entry_schema" : {\r
- "type" : ""\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.datatypes.Dynamic"\r
- }\r
- }\r
+{
+ "data_types" : {
+ "dt-config-assign-properties" : {
+ "description" : "Dynamic DataType definition for workflow(config-assign).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_vf_module_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
+ },
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-config-deploy-properties" : {
+ "description" : "Dynamic DataType definition for workflow(config-deploy).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
+ },
+ "derived_from" : "tosca.datatypes.Dynamic"
+ },
+ "dt-resource-assignment-properties" : {
+ "description" : "Dynamic DataType definition for workflow(resource-assignment).",
+ "version" : "1.0.0",
+ "properties" : {
+ "vlb_int_pktgen_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vf-module-name}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "private1-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vdns_onap_private_ip_0}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "public_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "sec_group" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nfc-naming-code" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnfc-model-invariant-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nexus_artifact_repo" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "https://nexus.onap.org",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vdns_name_0}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vdns_int_private_ip_0}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "dcae_collector_ip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vpg_name_0}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vip" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vip}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-naming-policy" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${int_private_net_id}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vfccustomizationuuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "demo_artifacts_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_int_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf-model-customization-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${int_private_subnet_id}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "key_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_name_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vlb_name_0}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "install_script_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_pktgen_private_net_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${int_pktgen_private_net_id}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vm-type" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnf_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "keypair" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "vlb_key",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "onap_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "aic-cloud-region" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "gre_ipaddr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${gre_ipaddr}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-model-customization-uuid" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pg_int" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${pg_int}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "dcae_collector_port" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "30227",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-label" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pktgen_private_net_cidr" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "private2-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vdns_flavor_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "m1.medium",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vnfc-model-version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "service-instance-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "nb_api_version" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "1.2.0",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vpg_int_pktgen_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vf-module-type" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "pub_key" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs84Cy8+qi/jvucay0BwFtOq3ian0ulTXFGxkZcZCR0N48j88pbHJaEqb9e25MAsrfH+7Etb9Kd5nbBThEL/i0AyHXnDsc80Oq0sqlLcfLo3SGSurkrNoRofHboJ5Hn+N9SlWN5FCQGbTx1w3rjqR4LasAI6XxH9xpXSFyyge6ysVXH0cYaZ8sg98nFZa1fPJR9L8COjZvF+EYudub2RC5HVyV/sx7bliNFo9JwQh6du1abG4G7ZDjTIcYwYp21iq52UzWU28RVcAyY6AQZJu2lHLdsr8fPvyeWZpC5EqGsxI1G609m9G/dURRKwYfez/f2ATzpn5QjEX7LrLWBM8r Generated-by-Nova",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "management-prefix-id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "int_pktgen_private_subnet_id" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${int_pktgen_private_subnet_id}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "create-md-sal-vnf-param" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_onap_private_ip_0" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "cloud_env" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "openstack",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
+ "vlb_image_name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "entry_schema" : {
+ "type" : ""
+ }
+ }
+ },
+ "derived_from" : "tosca.datatypes.Dynamic"
+ }
+ }
}
\ No newline at end of file
-{\r
- "node_types" : {\r
- "component-netconf-executor" : {\r
- "description" : "This is Netconf Transaction Configuration Component API",\r
- "version" : "1.0.0",\r
- "attributes" : {\r
- "response-data" : {\r
- "required" : false,\r
- "type" : "json"\r
- }\r
- },\r
- "capabilities" : {\r
- "component-node" : {\r
- "type" : "tosca.capabilities.Node"\r
- }\r
- },\r
- "requirements" : {\r
- "netconf-connection" : {\r
- "capability" : "netconf",\r
- "node" : "vnf-netconf-device",\r
- "relationship" : "tosca.relationships.ConnectsTo"\r
- }\r
- },\r
- "interfaces" : {\r
- "ComponentNetconfExecutor" : {\r
- "operations" : {\r
- "process" : {\r
- "inputs" : {\r
- "script-type" : {\r
- "description" : "Script type, kotlin type is supported",\r
- "required" : true,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "kotlin", "jython", "internal" ]\r
- } ],\r
- "default" : "internal"\r
- },\r
- "script-class-reference" : {\r
- "description" : "Kotlin Script class name or jython script name.",\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "instance-dependencies" : {\r
- "description" : "Instance names to inject to Jython or Kotlin Script.",\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "dynamic-properties" : {\r
- "description" : "Dynamic Json Content or DSL Json reference.",\r
- "required" : false,\r
- "type" : "json"\r
- }\r
- },\r
- "outputs" : {\r
- "response-data" : {\r
- "description" : "Execution Response Data in JSON format.",\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "status" : {\r
- "description" : "Status of the Component Execution ( success or failure )",\r
- "required" : true,\r
- "type" : "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.Component"\r
- },\r
-\r
- "component-script-executor":{\r
- "description": "This is CLI Transaction Configuration Component API",\r
- "version": "1.0.0",\r
- "attributes": {\r
- "response-data": {\r
- "required": false,\r
- "type": "json"\r
- }\r
- },\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces": {\r
- "ComponentScriptExecutor": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "script-type": {\r
- "description": "Script type, kotlin type is supported",\r
- "required": true,\r
- "type": "string",\r
- "default": "internal",\r
- "constraints": [\r
- {\r
- "valid_values": [\r
- "kotlin",\r
- "jython",\r
- "internal"\r
- ]\r
- }\r
- ]\r
- },\r
- "script-class-reference": {\r
- "description": "Kotlin Script class name or jython script name.",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "dynamic-properties": {\r
- "description": "Dynamic Json Content or DSL Json reference.",\r
- "required": false,\r
- "type": "json"\r
- }\r
- },\r
- "outputs": {\r
- "response-data": {\r
- "description": "Execution Response Data.",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "status": {\r
- "description": "Status of the Component Execution ( success or failure )",\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Component"\r
-},\r
-\r
-\r
- "component-resource-resolution" : {\r
- "description" : "This is Resource Assignment Component API",\r
- "version" : "1.0.0",\r
- "attributes" : {\r
- "assignment-params" : {\r
- "required" : true,\r
- "type" : "string"\r
- }\r
- },\r
- "capabilities" : {\r
- "component-node" : {\r
- "type" : "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces" : {\r
- "ResourceResolutionComponent" : {\r
- "operations" : {\r
- "process" : {\r
- "inputs" : {\r
- "resolution-key" : {\r
- "description" : "Key for service instance related correlation.",\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "occurrence" : {\r
- "description" : "Number of time to perform the resolution.",\r
- "required" : false,\r
- "type" : "integer",\r
- "default" : 1\r
- },\r
- "store-result" : {\r
- "description" : "Whether or not to store the output.",\r
- "required" : false,\r
- "type" : "boolean"\r
- },\r
- "resource-type" : {\r
- "description" : "Request type.",\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "artifact-prefix-names" : {\r
- "description" : "Template , Resource Assignment Artifact Prefix names",\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "request-id" : {\r
- "description" : "Request Id, Unique Id for the request.",\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "resource-id" : {\r
- "description" : "Resource Id.",\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "action-name" : {\r
- "description" : "Action Name of the process",\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "dynamic-properties" : {\r
- "description" : "Dynamic Json Content or DSL Json reference.",\r
- "required" : false,\r
- "type" : "json"\r
- }\r
- },\r
- "outputs" : {\r
- "resource-assignment-params" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "status" : {\r
- "required" : true,\r
- "type" : "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.Component"\r
- },\r
- "dg-generic" : {\r
- "description" : "This is Generic Directed Graph Type",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "content" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "dependency-node-templates" : {\r
- "description" : "Dependent Step Components NodeTemplate name.",\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.Workflow"\r
- },\r
- "source-capability" : {\r
- "description" : "This is Component Resource Source Node Type",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "script-type" : {\r
- "required" : true,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "kotlin", "internal", "jython" ]\r
- } ],\r
- "default" : "kotlin"\r
- },\r
- "script-class-reference" : {\r
- "description" : "Capability reference name for internal and kotlin, for jython script file path",\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "instance-dependencies" : {\r
- "description" : "Instance dependency Names to Inject to Kotlin / Jython Script.",\r
- "required" : false,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "key-dependencies" : {\r
- "description" : "Resource Resolution dependency dictionary names.",\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.ResourceSource"\r
- },\r
- "source-db" : {\r
- "description" : "This is Database Resource Source Node Type",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "type" : {\r
- "required" : true,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "SQL", "PLSQL" ]\r
- } ],\r
- "default" : "SQL"\r
- },\r
- "endpoint-selector" : {\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "query" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "input-key-mapping" : {\r
- "required" : false,\r
- "type" : "map",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "output-key-mapping" : {\r
- "required" : false,\r
- "type" : "map",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "key-dependencies" : {\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.ResourceSource"\r
- },\r
- "source-default" : {\r
- "description" : "This is Default Resource Source Node Type",\r
- "version" : "1.0.0",\r
- "properties" : { },\r
- "derived_from" : "tosca.nodes.ResourceSource"\r
- },\r
- "source-input" : {\r
- "description" : "This is Input Resource Source Node Type",\r
- "version" : "1.0.0",\r
- "properties" : { },\r
- "derived_from" : "tosca.nodes.ResourceSource"\r
- },\r
- "source-rest" : {\r
- "description" : "This is Rest Resource Source Node Type",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "type" : {\r
- "required" : true,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "JSON" ]\r
- } ],\r
- "default" : "JSON"\r
- },\r
- "verb" : {\r
- "required" : true,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "GET", "POST", "DELETE", "PUT" ]\r
- } ],\r
- "default" : "GET"\r
- },\r
- "payload" : {\r
- "required" : false,\r
- "type" : "string",\r
- "default" : ""\r
- },\r
- "endpoint-selector" : {\r
- "required" : false,\r
- "type" : "string"\r
- },\r
- "url-path" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "path" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "expression-type" : {\r
- "required" : false,\r
- "type" : "string",\r
- "constraints" : [ {\r
- "valid_values" : [ "JSON_PATH", "JSON_POINTER" ]\r
- } ],\r
- "default" : "JSON_PATH"\r
- },\r
- "input-key-mapping" : {\r
- "required" : false,\r
- "type" : "map",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "output-key-mapping" : {\r
- "required" : false,\r
- "type" : "map",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- },\r
- "key-dependencies" : {\r
- "required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "string"\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.ResourceSource"\r
- },\r
- "tosca.nodes.Component" : {\r
- "description" : "This is default Component Node",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
- },\r
- "tosca.nodes.ResourceSource" : {\r
- "description" : "TOSCA base type for Resource Sources",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
- },\r
- "tosca.nodes.Vnf" : {\r
- "description" : "This is VNF Node Type",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
- },\r
- "tosca.nodes.Workflow" : {\r
- "description" : "This is Directed Graph Node Type",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
- },\r
- "vnf-netconf-device" : {\r
- "description" : "This is VNF Device with Netconf Capability",\r
- "version" : "1.0.0",\r
- "capabilities" : {\r
- "netconf" : {\r
- "type" : "tosca.capabilities.Netconf",\r
- "properties" : {\r
- "login-key" : {\r
- "required" : true,\r
- "type" : "string",\r
- "default" : "sdnc"\r
- },\r
- "login-account" : {\r
- "required" : true,\r
- "type" : "string",\r
- "default" : "sdnc-tacacs"\r
- },\r
- "source" : {\r
- "required" : false,\r
- "type" : "string",\r
- "default" : "npm"\r
- },\r
- "target-ip-address" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
- "port-number" : {\r
- "required" : true,\r
- "type" : "integer",\r
- "default" : 830\r
- },\r
- "connection-time-out" : {\r
- "required" : false,\r
- "type" : "integer",\r
- "default" : 30\r
- }\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.Vnf"\r
- }\r
- }\r
+{
+ "node_types" : {
+ "component-netconf-executor" : {
+ "description" : "This is Netconf Transaction Configuration Component API",
+ "version" : "1.0.0",
+ "attributes" : {
+ "response-data" : {
+ "required" : false,
+ "type" : "json"
+ }
+ },
+ "capabilities" : {
+ "component-node" : {
+ "type" : "tosca.capabilities.Node"
+ }
+ },
+ "requirements" : {
+ "netconf-connection" : {
+ "capability" : "netconf",
+ "node" : "vnf-netconf-device",
+ "relationship" : "tosca.relationships.ConnectsTo"
+ }
+ },
+ "interfaces" : {
+ "ComponentNetconfExecutor" : {
+ "operations" : {
+ "process" : {
+ "inputs" : {
+ "script-type" : {
+ "description" : "Script type, kotlin type is supported",
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "kotlin", "jython", "internal" ]
+ } ],
+ "default" : "internal"
+ },
+ "script-class-reference" : {
+ "description" : "Kotlin Script class name or jython script name.",
+ "required" : true,
+ "type" : "string"
+ },
+ "instance-dependencies" : {
+ "description" : "Instance names to inject to Jython or Kotlin Script.",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ },
+ "dynamic-properties" : {
+ "description" : "Dynamic Json Content or DSL Json reference.",
+ "required" : false,
+ "type" : "json"
+ }
+ },
+ "outputs" : {
+ "response-data" : {
+ "description" : "Execution Response Data in JSON format.",
+ "required" : false,
+ "type" : "string"
+ },
+ "status" : {
+ "description" : "Status of the Component Execution ( success or failure )",
+ "required" : true,
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "derived_from" : "tosca.nodes.Component"
+ },
+ "component-resource-resolution" : {
+ "description" : "This is Resource Assignment Component API",
+ "version" : "1.0.0",
+ "attributes" : {
+ "assignment-params" : {
+ "description" : "Holds resolved template, resolution-summary or key-value",
+ "required" : true,
+ "type" : "string"
+ },
+ "assignment-map" : {
+ "description" : "Holds resolved values for each artifact prefix eg. { vdns: { vnf-id: 123 } }",
+ "required" : true,
+ "type" : "map"
+ }
+ },
+ "capabilities" : {
+ "component-node" : {
+ "type" : "tosca.capabilities.Node"
+ }
+ },
+ "interfaces" : {
+ "ResourceResolutionComponent" : {
+ "operations" : {
+ "process" : {
+ "inputs" : {
+ "resolution-key" : {
+ "description" : "Key for service instance related correlation.",
+ "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,
+ "type" : "boolean"
+ },
+ "resource-type" : {
+ "description" : "Request type.",
+ "required" : false,
+ "type" : "string"
+ },
+ "resolution-summary" : {
+ "description" : "Enable resolution-summary output",
+ "required" : false,
+ "type" : "boolean"
+ },
+ "artifact-prefix-names" : {
+ "description" : "Template , Resource Assignment Artifact Prefix names",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ },
+ "request-id" : {
+ "description" : "Request Id, Unique Id for the request.",
+ "required" : true,
+ "type" : "string"
+ },
+ "resource-id" : {
+ "description" : "Resource Id.",
+ "required" : false,
+ "type" : "string"
+ },
+ "action-name" : {
+ "description" : "Action Name of the process",
+ "required" : false,
+ "type" : "string"
+ },
+ "dynamic-properties" : {
+ "description" : "Dynamic Json Content or DSL Json reference.",
+ "required" : false,
+ "type" : "json"
+ }
+ },
+ "outputs" : {
+ "resource-assignment-params" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "resource-assignment-map" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "status" : {
+ "required" : true,
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "derived_from" : "tosca.nodes.Component"
+ },
+ "dg-generic" : {
+ "description" : "This is Generic Directed Graph Type",
+ "version" : "1.0.0",
+ "properties" : {
+ "content" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "dependency-node-templates" : {
+ "description" : "Dependent Step Components NodeTemplate name.",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ }
+ },
+ "derived_from" : "tosca.nodes.Workflow"
+ },
+ "source-capability" : {
+ "description" : "This is Component Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : {
+ "script-type" : {
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "kotlin", "internal", "jython" ]
+ } ],
+ "default" : "kotlin"
+ },
+ "script-class-reference" : {
+ "description" : "Capability reference name for internal and kotlin, for jython script file path",
+ "required" : true,
+ "type" : "string"
+ },
+ "instance-dependencies" : {
+ "description" : "Instance dependency Names to Inject to Kotlin / Jython Script.",
+ "required" : false,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ },
+ "key-dependencies" : {
+ "description" : "Resource Resolution dependency dictionary names.",
+ "required" : true,
+ "type" : "list",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ }
+ },
+ "derived_from" : "tosca.nodes.ResourceSource"
+ },
+ "source-db" : {
+ "description" : "This is Database Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : {
+ "type" : {
+ "required" : true,
+ "type" : "string",
+ "constraints" : [ {
+ "valid_values" : [ "SQL", "PLSQL" ]
+ } ],
+ "default" : "SQL"
+ },
+ "endpoint-selector" : {
+ "required" : false,
+ "type" : "string"
+ },
+ "query" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "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"
+ },
+ "source-default" : {
+ "description" : "This is Default Resource Source Node Type",
+ "version" : "1.0.0",
+ "properties" : { },
+ "derived_from" : "tosca.nodes.ResourceSource"
+ },
+ "source-input" : {
+ "description" : "This is Input Resource Source Node Type",
+ "version" : "1.0.0",
+ "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",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "tosca.nodes.ResourceSource" : {
+ "description" : "TOSCA base type for Resource Sources",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "tosca.nodes.Vnf" : {
+ "description" : "This is VNF Node Type",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "tosca.nodes.Workflow" : {
+ "description" : "This is Directed Graph Node Type",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
+ "vnf-netconf-device" : {
+ "description" : "This is VNF Device with Netconf Capability",
+ "version" : "1.0.0",
+ "capabilities" : {
+ "netconf" : {
+ "type" : "tosca.capabilities.Netconf",
+ "properties" : {
+ "login-key" : {
+ "required" : true,
+ "type" : "string",
+ "default" : "sdnc"
+ },
+ "login-account" : {
+ "required" : true,
+ "type" : "string",
+ "default" : "sdnc-tacacs"
+ },
+ "source" : {
+ "required" : false,
+ "type" : "string",
+ "default" : "npm"
+ },
+ "target-ip-address" : {
+ "required" : true,
+ "type" : "string"
+ },
+ "port-number" : {
+ "required" : true,
+ "type" : "integer",
+ "default" : 830
+ },
+ "connection-time-out" : {
+ "required" : false,
+ "type" : "integer",
+ "default" : 30
+ }
+ }
+ }
+ },
+ "derived_from" : "tosca.nodes.Vnf"
+ }
+ }
}
\ No newline at end of file
-{\r
- "policy_types" : { }\r
+{
+ "policy_types" : { }
}
\ No newline at end of file
-{\r
- "relationship_types" : {\r
- "tosca.relationships.ConnectsTo" : {\r
- "description" : "Relationship tosca.relationships.ConnectsTo",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.relationships.Root"\r
- }\r
- }\r
+{
+ "relationship_types" : {
+ "tosca.relationships.ConnectsTo" : {
+ "description" : "Relationship tosca.relationships.ConnectsTo",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.relationships.Root"
+ }
+ }
}
\ No newline at end of file
-{\r
- "aic-cloud-region" : {\r
- "tags" : "aic-cloud-region",\r
- "name" : "aic-cloud-region",\r
- "property" : {\r
- "description" : "aic-cloud-region",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input",\r
- "properties" : { }\r
- }\r
- }\r
- },\r
- "cloud_env" : {\r
- "tags" : "cloud_env",\r
- "name" : "cloud_env",\r
- "property" : {\r
- "description" : "cloud_env",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/cloud_env",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "cloud_env" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "create-md-sal-vnf-param" : {\r
- "tags" : "create-md-sal-vnf-param",\r
- "name" : "create-md-sal-vnf-param",\r
- "property" : {\r
- "description" : "create-md-sal-vnf-param",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "type" : "JSON",\r
- "verb" : "PUT",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",\r
- "path" : "",\r
- "payload" : "{\n\"GENERIC-RESOURCE-API:param\": [\n{\n\"GENERIC-RESOURCE-API:name\": \"vdns_vf_module_id\",\n\"GENERIC-RESOURCE-API:value\": \"$vf-module-id\"\n}\n]\n}",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id",\r
- "vf-module-id" : "vf-module-id"\r
- },\r
- "output-key-mapping" : { },\r
- "key-dependencies" : [ "vf-module-id", "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "aai-data" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "PATCH",\r
- "type" : "JSON",\r
- "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/nm-profile-name",\r
- "payload" : "{\"nm-profile-name\":\"$vf-module-id\"}",\r
- "path" : "",\r
- "input-key-mapping" : {\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : { },\r
- "key-dependencies" : [ "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "dcae_collector_ip" : {\r
- "tags" : "dcae_collector_ip",\r
- "name" : "dcae_collector_ip",\r
- "property" : {\r
- "description" : "dcae_collector_ip",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_ip",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "dcae_collector_ip" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "dcae_collector_port" : {\r
- "tags" : "dcae_collector_port",\r
- "name" : "dcae_collector_port",\r
- "property" : {\r
- "description" : "dcae_collector_port",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_port",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "dcae_collector_port" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "demo_artifacts_version" : {\r
- "tags" : "demo_artifacts_version",\r
- "name" : "demo_artifacts_version",\r
- "property" : {\r
- "description" : "demo_artifacts_version",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/demo_artifacts_version",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "demo_artifacts_version" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "flavor_name" : {\r
- "tags" : "flavor_name",\r
- "name" : "flavor_name",\r
- "property" : {\r
- "description" : "flavor_name",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/flavor_name",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "flavor_name" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "gre_ipaddr" : {\r
- "tags" : "gre_ipaddr",\r
- "name" : "gre_ipaddr",\r
- "property" : {\r
- "description" : "gre_ipaddr",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/gre_ipaddr",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "gre_ipaddr" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "image_name" : {\r
- "tags" : "image_name",\r
- "name" : "image_name",\r
- "property" : {\r
- "description" : "image_name",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/image_name",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "image_name" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "install_script_version" : {\r
- "tags" : "install_script_version",\r
- "name" : "install_script_version",\r
- "property" : {\r
- "description" : "install_script_version",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/install_script_version",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "install_script_version" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "int_pktgen_private_net_id" : {\r
- "tags" : "int_pktgen_private_net_id",\r
- "name" : "int_pktgen_private_net_id",\r
- "property" : {\r
- "description" : "int_pktgen_private_net_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_net_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "int_pktgen_private_net_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "int_pktgen_private_subnet_id" : {\r
- "tags" : "int_pktgen_private_subnet_id",\r
- "name" : "int_pktgen_private_subnet_id",\r
- "property" : {\r
- "description" : "int_pktgen_private_subnet_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_subnet_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "int_pktgen_private_subnet_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "int_private_net_id" : {\r
- "tags" : "int_private_net_id",\r
- "name" : "int_private_net_id",\r
- "property" : {\r
- "description" : "int_private_net_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_net_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "int_private_net_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "int_private_subnet_id" : {\r
- "tags" : "int_private_subnet_id",\r
- "name" : "int_private_subnet_id",\r
- "property" : {\r
- "description" : "int_private_subnet_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_subnet_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "int_private_subnet_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "key_name" : {\r
- "tags" : "key_name",\r
- "name" : "key_name",\r
- "property" : {\r
- "description" : "key_name",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/key_name",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "key_name" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "keypair" : {\r
- "tags" : "keypair",\r
- "name" : "keypair",\r
- "property" : {\r
- "description" : "keypair",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/keypair",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "keypair" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "management-prefix-id" : {\r
- "tags" : "management-prefix-id",\r
- "name" : "management-prefix-id",\r
- "property" : {\r
- "description" : "management-prefix-id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/management-prefix-id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "management-prefix-id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"management\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "management-prefix-id" : "prefix_id"\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "nb_api_version" : {\r
- "tags" : "nb_api_version",\r
- "name" : "nb_api_version",\r
- "property" : {\r
- "description" : "nb_api_version",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nb_api_version",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "nb_api_version" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "nexus_artifact_repo" : {\r
- "tags" : "nexus_artifact_repo",\r
- "name" : "nexus_artifact_repo",\r
- "property" : {\r
- "description" : "nexus_artifact_repo",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nexus_artifact_repo",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "nexus_artifact_repo" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "nfc-naming-code" : {\r
- "tags" : "nfc-naming-code",\r
- "name" : "nfc-naming-code",\r
- "property" : {\r
- "description" : "nfc-naming-code",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
- "input-key-mapping" : {\r
- "vfccustomizationuuid" : "vfccustomizationuuid"\r
- },\r
- "output-key-mapping" : {\r
- "nfc-naming-code" : "nfc_naming_code"\r
- },\r
- "key-dependencies" : [ "vfccustomizationuuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "onap_private_net_cidr" : {\r
- "tags" : "onap_private_net_cidr",\r
- "name" : "onap_private_net_cidr",\r
- "property" : {\r
- "description" : "onap_private_net_cidr",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"management\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "onap_private_net_cidr" : "prefix"\r
- }\r
- }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_cidr",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "onap_private_net_cidr" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "onap_private_net_id" : {\r
- "tags" : "onap_private_net_id",\r
- "name" : "onap_private_net_id",\r
- "property" : {\r
- "description" : "onap_private_net_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "onap_private_net_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "onap_private_subnet_id" : {\r
- "tags" : "onap_private_subnet_id",\r
- "name" : "onap_private_subnet_id",\r
- "property" : {\r
- "description" : "onap_private_subnet_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_subnet_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "onap_private_subnet_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "pg_int" : {\r
- "tags" : "pg_int",\r
- "name" : "pg_int",\r
- "property" : {\r
- "description" : "pg_int",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pg_int",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "pg_int" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "pktgen_private_net_cidr" : {\r
- "tags" : "pktgen_private_net_cidr",\r
- "name" : "pktgen_private_net_cidr",\r
- "property" : {\r
- "description" : "pktgen_private_net_cidr",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private2\"",\r
- "output-key-mapping" : {\r
- "pktgen_private_net_cidr" : "prefix"\r
- },\r
- "input-key-mapping" : { }\r
- }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pktgen_private_net_cidr",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "pktgen_private_net_cidr" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "private1-prefix-id" : {\r
- "tags" : "private1-prefix-id",\r
- "name" : "private1-prefix-id",\r
- "property" : {\r
- "description" : "private1-prefix-id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private1-prefix-id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "private1-prefix-id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private1\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "private1-prefix-id" : "prefix_id"\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "private2-prefix-id" : {\r
- "tags" : "private2-prefix-id",\r
- "name" : "private2-prefix-id",\r
- "property" : {\r
- "description" : "private2-prefix-id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private2-prefix-id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "private2-prefix-id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private2\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "private2-prefix-id" : "prefix_id"\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "pub_key" : {\r
- "tags" : "pub_key",\r
- "name" : "pub_key",\r
- "property" : {\r
- "description" : "pub_key",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pub_key",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "pub_key" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "public_net_id" : {\r
- "tags" : "public_net_id",\r
- "name" : "public_net_id",\r
- "property" : {\r
- "description" : "public_net_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/public_net_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "public_net_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "sec_group" : {\r
- "tags" : "sec_group",\r
- "name" : "sec_group",\r
- "property" : {\r
- "description" : "sec_group",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/sec_group",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "sec_group" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "service-instance-id" : {\r
- "tags" : "service-instance-id, tosca.datatypes.Root, data_type",\r
- "name" : "service-instance-id",\r
- "property" : {\r
- "description" : "To be provided",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input",\r
- "properties" : { }\r
- },\r
- "any-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "query" : "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "service-instance-id" : "artifact_name"\r
- }\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "query" : "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "service-instance-id" : "artifact_name"\r
- }\r
- }\r
- },\r
- "capability" : {\r
- "type" : "source-capability",\r
- "properties" : {\r
- "script-type" : "jython",\r
- "script-class-reference" : "SampleRAProcessor",\r
- "instance-dependencies" : [ ]\r
- }\r
- }\r
- }\r
- },\r
- "vdns_int_private_ip_0" : {\r
- "tags" : "vdns_int_private_ip_0",\r
- "name" : "vdns_int_private_ip_0",\r
- "property" : {\r
- "description" : "vdns_int_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_int_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id",\r
- "vdns_vf_module_id" : "vdns_vf_module_id"\r
- },\r
- "output-key-mapping" : {\r
- "vdns_int_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vdns_name_0" : {\r
- "tags" : "vdns_name_0",\r
- "name" : "vdns_name_0",\r
- "property" : {\r
- "description" : "vdns_name_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_name_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vdns_name_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vdns_onap_private_ip_0" : {\r
- "tags" : "vdns_onap_private_ip_0",\r
- "name" : "vdns_onap_private_ip_0",\r
- "property" : {\r
- "description" : "vdns_onap_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_onap_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id",\r
- "vdns_vf_module_id" : "vdns_vf_module_id"\r
- },\r
- "output-key-mapping" : {\r
- "vdns_onap_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vdns_vf_module_id" : {\r
- "tags" : "vdns_vf_module_id",\r
- "name" : "vdns_vf_module_id",\r
- "property" : {\r
- "description" : "vdns_vf_module_id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vdns_vf_module_id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "aai-data" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",\r
- "path" : "",\r
- "input-key-mapping" : {\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vdns_vf_module_id" : "nm-profile-name"\r
- },\r
- "key-dependencies" : [ "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vf-module-id" : {\r
- "tags" : "vf-module-id",\r
- "name" : "vf-module-id",\r
- "property" : {\r
- "description" : "vf-module-id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input",\r
- "properties" : { }\r
- }\r
- }\r
- },\r
- "vf-module-label" : {\r
- "tags" : "vf-module-label",\r
- "name" : "vf-module-label",\r
- "property" : {\r
- "description" : "vf-module-label",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",\r
- "input-key-mapping" : {\r
- "customizationid" : "vf-module-model-customization-uuid"\r
- },\r
- "output-key-mapping" : {\r
- "vf-module-label" : "vf_module_label"\r
- },\r
- "key-dependencies" : [ "vf-module-model-customization-uuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vf-module-model-customization-uuid" : {\r
- "tags" : "vf-module-model-customization-uuid",\r
- "name" : "vf-module-model-customization-uuid",\r
- "property" : {\r
- "description" : "vf-module-model-customization-uuid",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- }\r
- }\r
- },\r
- "vf-module-type" : {\r
- "tags" : "vf-module-type",\r
- "name" : "vf-module-type",\r
- "property" : {\r
- "description" : "vf-module-type",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",\r
- "output-key-mapping" : {\r
- "vf-module-type" : "vf_module_type"\r
- },\r
- "input-key-mapping" : {\r
- "customizationid" : "vf-module-model-customization-uuid"\r
- },\r
- "key-dependencies" : [ "vf-module-model-customization-uuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vf-naming-policy" : {\r
- "tags" : "vf-naming-policy",\r
- "name" : "vf-naming-policy",\r
- "property" : {\r
- "description" : "vf-naming-policy",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vf-naming-policy",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vf-naming-policy" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",\r
- "input-key-mapping" : {\r
- "vnf_model_customization_uuid" : "vnf-model-customization-uuid"\r
- },\r
- "output-key-mapping" : {\r
- "vf-naming-policy" : "vf_naming_policy"\r
- },\r
- "key-dependencies" : [ "vnf-model-customization-uuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vf_module_name" : {\r
- "tags" : "vf_module_name",\r
- "name" : "vf_module_name",\r
- "property" : {\r
- "description" : "vf_module_name",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- }\r
- }\r
- },\r
- "vfccustomizationuuid" : {\r
- "tags" : "vfccustomizationuuid",\r
- "name" : "vfccustomizationuuid",\r
- "property" : {\r
- "description" : "vfccustomizationuuid",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",\r
- "input-key-mapping" : {\r
- "vfmodulecustomizationuuid" : "vf-module-model-customization-uuid"\r
- },\r
- "output-key-mapping" : {\r
- "vfccustomizationuuid" : "vnf_customid"\r
- },\r
- "key-dependencies" : [ "vf-module-model-customization-uuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vip" : {\r
- "tags" : "vip",\r
- "name" : "vip",\r
- "property" : {\r
- "description" : "vip",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vip",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vip" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vlb_int_pktgen_private_ip_0" : {\r
- "tags" : "vlb_int_pktgen_private_ip_0",\r
- "name" : "vlb_int_pktgen_private_ip_0",\r
- "property" : {\r
- "description" : "vlb_int_pktgen_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_pktgen_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vlb_int_pktgen_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vlb_int_private_ip_0" : {\r
- "tags" : "vlb_int_private_ip_0",\r
- "name" : "vlb_int_private_ip_0",\r
- "property" : {\r
- "description" : "vlb_int_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vlb_int_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vlb_name_0" : {\r
- "tags" : "vlb_name_0",\r
- "name" : "vlb_name_0",\r
- "property" : {\r
- "description" : "vlb_name_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_name_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vlb_name_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vlb_onap_private_ip_0" : {\r
- "tags" : "vlb_onap_private_ip_0",\r
- "name" : "vlb_onap_private_ip_0",\r
- "property" : {\r
- "description" : "vlb_onap_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_onap_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "private2-prefix-id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vlb_private_net_cidr" : {\r
- "tags" : "vlb_private_net_cidr",\r
- "name" : "vlb_private_net_cidr",\r
- "property" : {\r
- "description" : "vlb_private_net_cidr",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_private_net_cidr",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vlb_private_net_cidr" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private1\"",\r
- "input-key-mapping" : { },\r
- "output-key-mapping" : {\r
- "vlb_private_net_cidr" : "prefix"\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "vm-type" : {\r
- "tags" : "vm-type",\r
- "name" : "vm-type",\r
- "property" : {\r
- "description" : "vm-type",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select VFC_MODEL.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
- "output-key-mapping" : {\r
- "vm-type" : "vm_type"\r
- },\r
- "input-key-mapping" : {\r
- "vfccustomizationuuid" : "vfccustomizationuuid"\r
- },\r
- "key-dependencies" : [ "vfccustomizationuuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vnf-id" : {\r
- "tags" : "vnf-id",\r
- "name" : "vnf-id",\r
- "property" : {\r
- "description" : "vnf-id",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf-id",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vnf-id" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vnf-model-customization-uuid" : {\r
- "tags" : "vnf-model-customization-uuid",\r
- "name" : "vnf-model-customization-uuid",\r
- "property" : {\r
- "description" : "vnf-model-customization-uuid",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input",\r
- "properties" : { }\r
- }\r
- }\r
- },\r
- "vnf_name" : {\r
- "tags" : "vnf_name",\r
- "name" : "vnf_name",\r
- "property" : {\r
- "description" : "vnf_name",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vnf_name" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vnfc-model-invariant-uuid" : {\r
- "tags" : "vnfc-model-invariant-uuid",\r
- "name" : "vnfc-model-invariant-uuid",\r
- "property" : {\r
- "description" : "vnfc-model-invariant-uuid",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select VFC_MODEL.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
- "output-key-mapping" : {\r
- "vnfc-model-invariant-uuid" : "vfc_invariant_uuid"\r
- },\r
- "input-key-mapping" : {\r
- "vfccustomizationuuid" : "vfccustomizationuuid"\r
- },\r
- "key-dependencies" : [ "vfccustomizationuuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vnfc-model-version" : {\r
- "tags" : "vnfc-model-version",\r
- "name" : "vnfc-model-version",\r
- "property" : {\r
- "description" : "vnfc-model-version",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "processor-db" : {\r
- "type" : "source-db",\r
- "properties" : {\r
- "type" : "SQL",\r
- "query" : "select VFC_MODEL.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
- "output-key-mapping" : {\r
- "vnfc-model-version" : "vnfc_model_version"\r
- },\r
- "input-key-mapping" : {\r
- "vfccustomizationuuid" : "vfccustomizationuuid"\r
- },\r
- "key-dependencies" : [ "vfccustomizationuuid" ]\r
- }\r
- }\r
- }\r
- },\r
- "vpg_int_pktgen_private_ip_0" : {\r
- "tags" : "vpg_int_pktgen_private_ip_0",\r
- "name" : "vpg_int_pktgen_private_ip_0",\r
- "property" : {\r
- "description" : "vpg_int_pktgen_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_int_pktgen_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vpg_int_pktgen_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vpg_name_0" : {\r
- "tags" : "vpg_name_0",\r
- "name" : "vpg_name_0",\r
- "property" : {\r
- "description" : "vlb_name_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_name_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vpg_name_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- },\r
- "vpg_onap_private_ip_0" : {\r
- "tags" : "vpg_onap_private_ip_0",\r
- "name" : "vpg_onap_private_ip_0",\r
- "property" : {\r
- "description" : "vpg_onap_private_ip_0",\r
- "type" : "string"\r
- },\r
- "updated-by" : "Singal, Kapil <ks220y@att.com>",\r
- "sources" : {\r
- "input" : {\r
- "type" : "source-input"\r
- },\r
- "default" : {\r
- "type" : "source-default",\r
- "properties" : { }\r
- },\r
- "sdnc" : {\r
- "type" : "source-rest",\r
- "properties" : {\r
- "verb" : "GET",\r
- "type" : "JSON",\r
- "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_onap_private_ip_0",\r
- "path" : "/param/0/value",\r
- "input-key-mapping" : {\r
- "service-instance-id" : "service-instance-id",\r
- "vnf-id" : "vnf-id"\r
- },\r
- "output-key-mapping" : {\r
- "vpg_onap_private_ip_0" : "value"\r
- },\r
- "key-dependencies" : [ "service-instance-id", "vnf-id" ]\r
- }\r
- }\r
- }\r
- }\r
-}\r
+{
+ "aic-cloud-region" : {
+ "tags" : "aic-cloud-region",
+ "name" : "aic-cloud-region",
+ "property" : {
+ "description" : "aic-cloud-region",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "cloud_env" : {
+ "tags" : "cloud_env",
+ "name" : "cloud_env",
+ "property" : {
+ "description" : "cloud_env",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/cloud_env",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "cloud_env" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "create-md-sal-vnf-param" : {
+ "tags" : "create-md-sal-vnf-param",
+ "name" : "create-md-sal-vnf-param",
+ "property" : {
+ "description" : "create-md-sal-vnf-param",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "verb" : "PUT",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
+ "path" : "",
+ "payload" : "{\n\"GENERIC-RESOURCE-API:param\": [\n{\n\"GENERIC-RESOURCE-API:name\": \"vdns_vf_module_id\",\n\"GENERIC-RESOURCE-API:value\": \"$vf-module-id\"\n}\n]\n}",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "vf-module-id", "service-instance-id", "vnf-id" ]
+ }
+ },
+ "aai-data" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "PATCH",
+ "type" : "JSON",
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id/nm-profile-name",
+ "payload" : "{\"nm-profile-name\":\"$vf-module-id\"}",
+ "path" : "",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : { },
+ "key-dependencies" : [ "vnf-id" ]
+ }
+ }
+ }
+ },
+ "dcae_collector_ip" : {
+ "tags" : "dcae_collector_ip",
+ "name" : "dcae_collector_ip",
+ "property" : {
+ "description" : "dcae_collector_ip",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_ip",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "dcae_collector_ip" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "dcae_collector_port" : {
+ "tags" : "dcae_collector_port",
+ "name" : "dcae_collector_port",
+ "property" : {
+ "description" : "dcae_collector_port",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/dcae_collector_port",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "dcae_collector_port" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "demo_artifacts_version" : {
+ "tags" : "demo_artifacts_version",
+ "name" : "demo_artifacts_version",
+ "property" : {
+ "description" : "demo_artifacts_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/demo_artifacts_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "demo_artifacts_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "flavor_name" : {
+ "tags" : "flavor_name",
+ "name" : "flavor_name",
+ "property" : {
+ "description" : "flavor_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/flavor_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "flavor_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "gre_ipaddr" : {
+ "tags" : "gre_ipaddr",
+ "name" : "gre_ipaddr",
+ "property" : {
+ "description" : "gre_ipaddr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/gre_ipaddr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "gre_ipaddr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "gre_ipaddr" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "image_name" : {
+ "tags" : "image_name",
+ "name" : "image_name",
+ "property" : {
+ "description" : "image_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/image_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "image_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "install_script_version" : {
+ "tags" : "install_script_version",
+ "name" : "install_script_version",
+ "property" : {
+ "description" : "install_script_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/install_script_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "install_script_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_pktgen_private_net_id" : {
+ "tags" : "int_pktgen_private_net_id",
+ "name" : "int_pktgen_private_net_id",
+ "property" : {
+ "description" : "int_pktgen_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_pktgen_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_pktgen_private_subnet_id" : {
+ "tags" : "int_pktgen_private_subnet_id",
+ "name" : "int_pktgen_private_subnet_id",
+ "property" : {
+ "description" : "int_pktgen_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_pktgen_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_pktgen_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_private_net_id" : {
+ "tags" : "int_private_net_id",
+ "name" : "int_private_net_id",
+ "property" : {
+ "description" : "int_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "int_private_subnet_id" : {
+ "tags" : "int_private_subnet_id",
+ "name" : "int_private_subnet_id",
+ "property" : {
+ "description" : "int_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/int_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "int_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "key_name" : {
+ "tags" : "key_name",
+ "name" : "key_name",
+ "property" : {
+ "description" : "key_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/key_name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "key_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "keypair" : {
+ "tags" : "keypair",
+ "name" : "keypair",
+ "property" : {
+ "description" : "keypair",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/keypair",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "keypair" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "management-prefix-id" : {
+ "tags" : "management-prefix-id",
+ "name" : "management-prefix-id",
+ "property" : {
+ "description" : "management-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/management-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "management-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"management\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "management-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "nb_api_version" : {
+ "tags" : "nb_api_version",
+ "name" : "nb_api_version",
+ "property" : {
+ "description" : "nb_api_version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nb_api_version",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "nb_api_version" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "nexus_artifact_repo" : {
+ "tags" : "nexus_artifact_repo",
+ "name" : "nexus_artifact_repo",
+ "property" : {
+ "description" : "nexus_artifact_repo",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/nexus_artifact_repo",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "nexus_artifact_repo" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "nfc-naming-code" : {
+ "tags" : "nfc-naming-code",
+ "name" : "nfc-naming-code",
+ "property" : {
+ "description" : "nfc-naming-code",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "output-key-mapping" : {
+ "nfc-naming-code" : "nfc_naming_code"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "onap_private_net_cidr" : {
+ "tags" : "onap_private_net_cidr",
+ "name" : "onap_private_net_cidr",
+ "property" : {
+ "description" : "onap_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"management\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "onap_private_net_cidr" : "prefix"
+ }
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "onap_private_net_id" : {
+ "tags" : "onap_private_net_id",
+ "name" : "onap_private_net_id",
+ "property" : {
+ "description" : "onap_private_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "onap_private_subnet_id" : {
+ "tags" : "onap_private_subnet_id",
+ "name" : "onap_private_subnet_id",
+ "property" : {
+ "description" : "onap_private_subnet_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/onap_private_subnet_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "onap_private_subnet_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "pg_int" : {
+ "tags" : "pg_int",
+ "name" : "pg_int",
+ "property" : {
+ "description" : "pg_int",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pg_int",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pg_int" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "pg_int" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "pktgen_private_net_cidr" : {
+ "tags" : "pktgen_private_net_cidr",
+ "name" : "pktgen_private_net_cidr",
+ "property" : {
+ "description" : "pktgen_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private2\"",
+ "output-key-mapping" : {
+ "pktgen_private_net_cidr" : "prefix"
+ },
+ "input-key-mapping" : { }
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pktgen_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pktgen_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "private1-prefix-id" : {
+ "tags" : "private1-prefix-id",
+ "name" : "private1-prefix-id",
+ "property" : {
+ "description" : "private1-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private1-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "private1-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private1\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "private1-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "private2-prefix-id" : {
+ "tags" : "private2-prefix-id",
+ "name" : "private2-prefix-id",
+ "property" : {
+ "description" : "private2-prefix-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/private2-prefix-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "private2-prefix-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private2\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "private2-prefix-id" : "prefix_id"
+ }
+ }
+ }
+ }
+ },
+ "pub_key" : {
+ "tags" : "pub_key",
+ "name" : "pub_key",
+ "property" : {
+ "description" : "pub_key",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pub_key",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "pub_key" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "public_net_id" : {
+ "tags" : "public_net_id",
+ "name" : "public_net_id",
+ "property" : {
+ "description" : "public_net_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/public_net_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "public_net_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "sec_group" : {
+ "tags" : "sec_group",
+ "name" : "sec_group",
+ "property" : {
+ "description" : "sec_group",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/sec_group",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "sec_group" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "service-instance-id" : {
+ "tags" : "service-instance-id, tosca.datatypes.Root, data_type",
+ "name" : "service-instance-id",
+ "property" : {
+ "description" : "To be provided",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ },
+ "any-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "service-instance-id" : "artifact_name"
+ }
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "service-instance-id" : "artifact_name"
+ }
+ }
+ },
+ "capability" : {
+ "type" : "source-capability",
+ "properties" : {
+ "script-type" : "jython",
+ "script-class-reference" : "SampleRAProcessor",
+ "instance-dependencies" : [ ]
+ }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id",
+ "path" : "/service/0/service-instance-id",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance.service-instance-id"
+ },
+ "output-key-mapping" : {
+ "service-instance-id" : "service-instance-id"
+ },
+ "key-dependencies" : [ "service-instance.service-instance-id" ]
+ }
+ }
+ }
+ },
+ "vdns_int_private_ip_0" : {
+ "tags" : "vdns_int_private_ip_0",
+ "name" : "vdns_int_private_ip_0",
+ "property" : {
+ "description" : "vdns_int_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_int_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vdns_vf_module_id" : "vdns_vf_module_id"
+ },
+ "output-key-mapping" : {
+ "vdns_int_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vdns_name_0" : {
+ "tags" : "vdns_name_0",
+ "name" : "vdns_name_0",
+ "property" : {
+ "description" : "vdns_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vdns_name_0\",\r\n\t\t\"resource-value\": \"${vdns_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vdns_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vdns_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vdns_onap_private_ip_0" : {
+ "tags" : "vdns_onap_private_ip_0",
+ "name" : "vdns_onap_private_ip_0",
+ "property" : {
+ "description" : "vdns_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vdns_vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vdns_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id",
+ "vdns_vf_module_id" : "vdns_vf_module_id"
+ },
+ "output-key-mapping" : {
+ "vdns_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vdns_vf_module_id" : {
+ "tags" : "vdns_vf_module_id",
+ "name" : "vdns_vf_module_id",
+ "property" : {
+ "description" : "vdns_vf_module_id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_vf_module_id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/aai/v14/network/generic-vnfs/generic-vnf/$vnf-id",
+ "path" : "",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vdns_vf_module_id" : "nm-profile-name"
+ },
+ "key-dependencies" : [ "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vf-module-id" : {
+ "tags" : "vf-module-id",
+ "name" : "vf-module-id",
+ "property" : {
+ "description" : "vf-module-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "vf-module-label" : {
+ "tags" : "vf-module-label",
+ "name" : "vf-module-label",
+ "property" : {
+ "description" : "vf-module-label",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
+ "input-key-mapping" : {
+ "customizationid" : "vf-module-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vf-module-label" : "vf_module_label"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vf-module-model-customization-uuid" : {
+ "tags" : "vf-module-model-customization-uuid",
+ "name" : "vf-module-model-customization-uuid",
+ "property" : {
+ "description" : "vf-module-model-customization-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ }
+ }
+ },
+ "vf-module-name" : {
+ "tags" : "vf-module-name",
+ "name" : "vf-module-name",
+ "property" : {
+ "description" : "vf-module-name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vf-module-name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vf-module-name\",\r\n \"resource-value\": \"${vf-module-name}\",\r\n \"external-key\": \"${vf-module-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VF-MODULE\",\r\n \"VNF_NAME\": \"${vnf_name}\",\r\n \"VF_MODULE_LABEL\":\"${vf-module-label}\",\r\n \"VF_MODULE_TYPE\":\"${vf-module-type}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "vnf_name" : "vnf_name",
+ "vf-module-label" : "vf-module-label",
+ "vf-module-type" : "vf-module-type",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "vnf_name", "vf-module-label", "vf-module-type", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vf-module-type" : {
+ "tags" : "vf-module-type",
+ "name" : "vf-module-type",
+ "property" : {
+ "description" : "vf-module-type",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",
+ "output-key-mapping" : {
+ "vf-module-type" : "vf_module_type"
+ },
+ "input-key-mapping" : {
+ "customizationid" : "vf-module-model-customization-uuid"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vf-naming-policy" : {
+ "tags" : "vf-naming-policy",
+ "name" : "vf-naming-policy",
+ "property" : {
+ "description" : "vf-naming-policy",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vf-naming-policy",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vf-naming-policy" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",
+ "input-key-mapping" : {
+ "vnf_model_customization_uuid" : "vnf-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vf-naming-policy" : "vf_naming_policy"
+ },
+ "key-dependencies" : [ "vnf-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vfccustomizationuuid" : {
+ "tags" : "vfccustomizationuuid",
+ "name" : "vfccustomizationuuid",
+ "property" : {
+ "description" : "vfccustomizationuuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",
+ "input-key-mapping" : {
+ "vfmodulecustomizationuuid" : "vf-module-model-customization-uuid"
+ },
+ "output-key-mapping" : {
+ "vfccustomizationuuid" : "vnf_customid"
+ },
+ "key-dependencies" : [ "vf-module-model-customization-uuid" ]
+ }
+ }
+ }
+ },
+ "vip" : {
+ "tags" : "vip",
+ "name" : "vip",
+ "property" : {
+ "description" : "vip",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vip",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vip" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vip" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_int_pktgen_private_ip_0" : {
+ "tags" : "vlb_int_pktgen_private_ip_0",
+ "name" : "vlb_int_pktgen_private_ip_0",
+ "property" : {
+ "description" : "vlb_int_pktgen_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_pktgen_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_pktgen_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_int_private_ip_0" : {
+ "tags" : "vlb_int_private_ip_0",
+ "name" : "vlb_int_private_ip_0",
+ "property" : {
+ "description" : "vlb_int_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_int_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_name_0" : {
+ "tags" : "vlb_name_0",
+ "name" : "vlb_name_0",
+ "property" : {
+ "description" : "vlb_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vlb_name_0\",\r\n\t\t\"resource-value\": \"${vlb_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vlb_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vlb_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
+ }
+ }
+ },
+ "vlb_onap_private_ip_0" : {
+ "tags" : "vlb_onap_private_ip_0",
+ "name" : "vlb_onap_private_ip_0",
+ "property" : {
+ "description" : "vlb_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vlb_private_net_cidr" : {
+ "tags" : "vlb_private_net_cidr",
+ "name" : "vlb_private_net_cidr",
+ "property" : {
+ "description" : "vlb_private_net_cidr",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vlb_private_net_cidr",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vlb_private_net_cidr" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private1\"",
+ "input-key-mapping" : { },
+ "output-key-mapping" : {
+ "vlb_private_net_cidr" : "prefix"
+ }
+ }
+ }
+ }
+ },
+ "vm-type" : {
+ "tags" : "vm-type",
+ "name" : "vm-type",
+ "property" : {
+ "description" : "vm-type",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vm-type" : "vm_type"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vnf-id" : {
+ "tags" : "vnf-id",
+ "name" : "vnf-id",
+ "property" : {
+ "description" : "vnf-id",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf-id",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vnf-id" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vnf-model-customization-uuid" : {
+ "tags" : "vnf-model-customization-uuid",
+ "name" : "vnf-model-customization-uuid",
+ "property" : {
+ "description" : "vnf-model-customization-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input",
+ "properties" : { }
+ }
+ }
+ },
+ "vnf_name" : {
+ "tags" : "vnf_name",
+ "name" : "vnf_name",
+ "property" : {
+ "description" : "vnf_name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name",
+ "path" : "/param/0/value",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vnf_name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vnf_name\",\r\n \"resource-value\": \"${vnf_name}\",\r\n \"external-key\": \"${vnf-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VNF\",\r\n \"AIC_CLOUD_REGION\": \"${aic-cloud-region}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id",
+ "aic-cloud-region" : "aic-cloud-region",
+ "vf-naming-policy" : "vf-naming-policy"
+ },
+ "output-key-mapping" : {
+ "vnf_name" : "resource-value"
+ },
+ "key-dependencies" : [ "vnf-id", "aic-cloud-region", "vf-naming-policy" ]
+ }
+ }
+ }
+ },
+ "vnfc-model-invariant-uuid" : {
+ "tags" : "vnfc-model-invariant-uuid",
+ "name" : "vnfc-model-invariant-uuid",
+ "property" : {
+ "description" : "vnfc-model-invariant-uuid",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vnfc-model-invariant-uuid" : "vfc_invariant_uuid"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vnfc-model-version" : {
+ "tags" : "vnfc-model-version",
+ "name" : "vnfc-model-version",
+ "property" : {
+ "description" : "vnfc-model-version",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "processor-db" : {
+ "type" : "source-db",
+ "properties" : {
+ "type" : "SQL",
+ "query" : "select VFC_MODEL.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
+ "output-key-mapping" : {
+ "vnfc-model-version" : "vnfc_model_version"
+ },
+ "input-key-mapping" : {
+ "vfccustomizationuuid" : "vfccustomizationuuid"
+ },
+ "key-dependencies" : [ "vfccustomizationuuid" ]
+ }
+ }
+ }
+ },
+ "vpg_int_pktgen_private_ip_0" : {
+ "tags" : "vpg_int_pktgen_private_ip_0",
+ "name" : "vpg_int_pktgen_private_ip_0",
+ "property" : {
+ "description" : "vpg_int_pktgen_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_int_pktgen_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_int_pktgen_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
+ }
+ }
+ },
+ "vpg_name_0" : {
+ "tags" : "vpg_name_0",
+ "name" : "vpg_name_0",
+ "property" : {
+ "description" : "vpg_name_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_name_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_name_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ }
+ }
+ },
+ "vpg_onap_private_ip_0" : {
+ "tags" : "vpg_onap_private_ip_0",
+ "name" : "vpg_onap_private_ip_0",
+ "property" : {
+ "description" : "vpg_onap_private_ip_0",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_onap_private_ip_0",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vpg_onap_private_ip_0" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
}\r
},\r
"execute" : {\r
- "type" : "component-script-executor",\r
+ "type" : "component-netconf-executor",\r
"requirements" : {\r
"netconf-connection" : {\r
"capability" : "netconf",\r
}\r
},\r
"interfaces" : {\r
- "ComponentScriptExecutor" : {\r
+ "ComponentNetconfExecutor" : {\r
"operations" : {\r
"process" : {\r
"inputs" : {\r
\r
override suspend fun processNB(executionRequest: ExecutionServiceInput) {\r
val resolution_key = getDynamicProperties("resolution-key").asText()\r
- log.info("resolution_key: $resolution_key"\n)\r
+ log.info("resolution_key: $resolution_key"\ n)\r
val payload = storedContentFromResolvedArtifactNB(resolution_key, "baseconfig")\r
- log.info("configuration: \n$payload"\n)\r
+ log.info("configuration: \n$payload"\ n)\r
log.info("Waiting 1 minute and 30 seconds or vLB to initialize ...")\r
Thread.sleep(90000)\r
val netconf_device = netconfDevice("netconf-connection")\r
//var payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode\r
//var vdns_ip: String = payloadObject.get("vdns-instance")[0].get("ip-addr").asText()\r
netconf_session.disconnect()\r
-\r
-\r
}\r
\r
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {\r
CSAR-Version: 1.0\r
Created-By: PLATANIA, MARCO <platania@research.att.com>\r
Entry-Definitions: Definitions/vLB_CDS_KOTLIN.json\r
-Template-Tags: vDNS-CDS-test1\r
+Template-Tags: test, vDNS-CDS, SCALE-OUT, MARCO\r
+Template-Name: vLB_CDS_KOTLIN\r
+Template-Version: 1.0.0\r
Content-Type: application/vnd.oasis.bpmn
\ No newline at end of file
"description" : "Dynamic DataType definition for workflow(config-deploy).",
"version" : "1.0.0",
"properties" : {
- "vdns_int_private_ip_0" : {
- "description" : "",
- "required" : false,
- "type" : "string",
- "status" : "",
- "constraints" : [ { } ],
- "entry_schema" : {
- "type" : ""
- }
- },
"vnf-id" : {
"description" : "",
"required" : false,
"type" : ""
}
},
- "vdns_vf_module_id" : {
- "description" : "",
- "required" : false,
- "type" : "string",
- "status" : "",
- "constraints" : [ { } ],
- "entry_schema" : {
- "type" : ""
- }
- },
"service-instance-id" : {
"description" : "",
"required" : false,
"type" : ""
}
},
- "vdns_onap_private_ip_0" : {
- "description" : "",
- "required" : false,
- "type" : "string",
- "status" : "",
- "constraints" : [ { } ],
- "entry_schema" : {
- "type" : ""
- }
- },
"ip" : {
"description" : "",
"required" : false,
"type" : ""
}
},
+ "vf-module-name" : {
+ "description" : "",
+ "required" : false,
+ "type" : "string",
+ "status" : "",
+ "constraints" : [ { } ],
+ "default" : "${vf-module-name}",
+ "entry_schema" : {
+ "type" : ""
+ }
+ },
"private1-prefix-id" : {
"description" : "",
"required" : false,
"type" : "string",
"status" : "",
"constraints" : [ { } ],
+ "default" : "",
"entry_schema" : {
"type" : ""
}
"type" : "string",
"status" : "",
"constraints" : [ { } ],
+ "default" : "",
"entry_schema" : {
"type" : ""
}
"type" : ""
}
},
- "vf_module_name" : {
- "description" : "",
- "required" : false,
- "type" : "string",
- "status" : "",
- "constraints" : [ { } ],
- "default" : "${vf_module_name}",
- "entry_schema" : {
- "type" : ""
- }
- },
"pg_int" : {
"description" : "",
"required" : false,
"type" : "string",
"status" : "",
"constraints" : [ { } ],
+ "default" : "",
"entry_schema" : {
"type" : ""
}
"type" : "string",
"status" : "",
"constraints" : [ { } ],
+ "default" : "",
"entry_schema" : {
"type" : ""
}
{
"node_types" : {
- "component-script-executor":{
- "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"
- }
- },
- "interfaces": {
- "ComponentScriptExecutor": {
- "operations": {
- "process": {
- "inputs": {
- "script-type": {
- "description": "Script type, kotlin type is supported",
- "required": true,
- "type": "string",
- "default": "internal",
- "constraints": [
- {
- "valid_values": [
- "kotlin",
- "jython",
- "internal"
- ]
- }
- ]
- },
- "script-class-reference": {
- "description": "Kotlin Script class name or jython script name.",
- "required": true,
- "type": "string"
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- }
- },
- "outputs": {
- "response-data": {
- "description": "Execution Response Data.",
- "required": false,
- "type": "string"
- },
- "status": {
- "description": "Status of the Component Execution ( success or failure )",
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
-},
-
- "component-netconf-executor" : {
+ "component-netconf-executor" : {
"description" : "This is Netconf Transaction Configuration Component API",
"version" : "1.0.0",
"attributes" : {
"version" : "1.0.0",
"attributes" : {
"assignment-params" : {
+ "description" : "Holds resolved template, resolution-summary or key-value",
"required" : true,
"type" : "string"
+ },
+ "assignment-map" : {
+ "description" : "Holds resolved values for each artifact prefix eg. { vdns: { vnf-id: 123 } }",
+ "required" : true,
+ "type" : "map"
}
},
"capabilities" : {
"required" : false,
"type" : "string"
},
+ "resolution-summary" : {
+ "description" : "Enable resolution-summary output",
+ "required" : false,
+ "type" : "boolean"
+ },
"artifact-prefix-names" : {
"description" : "Template , Resource Assignment Artifact Prefix names",
"required" : true,
"required" : true,
"type" : "string"
},
+ "resource-assignment-map" : {
+ "required" : true,
+ "type" : "string"
+ },
"status" : {
"required" : true,
"type" : "string"
} ],
"default" : "JSON"
},
+ "headers" : {
+ "required" : false,
+ "type" : "map",
+ "entry_schema" : {
+ "type" : "string"
+ }
+ },
"verb" : {
"required" : true,
"type" : "string",
}
},
"restconf" : {
- "type" : "tosca.capabilities.Netconf",
+ "type" : "tosca.capabilities.Restconf",
"properties" : {
"login-key" : {
"required" : true,
- "type" : "string",
- "default" : "sdnc"
+ "type" : "string"
},
"login-account" : {
"required" : true,
- "type" : "string",
- "default" : "sdnc-tacacs"
- },
- "source" : {
- "required" : false,
- "type" : "string",
- "default" : "npm"
+ "type" : "string"
},
"target-ip-address" : {
"required" : true,
},
"port-number" : {
"required" : true,
- "type" : "integer",
- "default" : 830
+ "type" : "integer"
},
"connection-time-out" : {
"required" : false,
"description" : "aic-cloud-region",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
"description" : "cloud_env",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "create-md-sal-vnf-param",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"sdnc" : {
"type" : "source-rest",
"properties" : {
"type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
"verb" : "PUT",
"url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vdns_vf_module_id",
"path" : "",
"description" : "dcae_collector_ip",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "dcae_collector_port",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "demo_artifacts_version",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "flavor_name",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "gre_ipaddr",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "gre_ipaddr" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
}
}
},
"description" : "image_name",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "install_script_version",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "int_pktgen_private_net_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "int_pktgen_private_subnet_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "int_private_net_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "int_private_subnet_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "key_name",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "keypair",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "management-prefix-id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "nb_api_version",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "nexus_artifact_repo",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "nfc-naming-code",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "onap_private_net_cidr",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "onap_private_net_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "onap_private_subnet_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "pg_int",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "pg_int" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
}
}
},
"description" : "pktgen_private_net_cidr",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "private1-prefix-id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "private2-prefix-id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "pub_key",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "public_net_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "sec_group",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "To be provided",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
"any-db" : {
"type" : "source-db",
"properties" : {
- "query" : "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
"input-key-mapping" : { },
"output-key-mapping" : {
"service-instance-id" : "artifact_name"
"processor-db" : {
"type" : "source-db",
"properties" : {
- "query" : "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
+ "query" : "SELECT artifact_name FROM BLUEPRINT_MODEL where artifact_version=\"1.0.0\"",
"input-key-mapping" : { },
"output-key-mapping" : {
"service-instance-id" : "artifact_name"
"script-class-reference" : "SampleRAProcessor",
"instance-dependencies" : [ ]
}
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id",
+ "path" : "/service/0/service-instance-id",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance.service-instance-id"
+ },
+ "output-key-mapping" : {
+ "service-instance-id" : "service-instance-id"
+ },
+ "key-dependencies" : [ "service-instance.service-instance-id" ]
+ }
}
}
},
"description" : "vdns_int_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
}
}
},
"description" : "vdns_name_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vdns_name_0\",\r\n\t\t\"resource-value\": \"${vdns_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vdns_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vdns_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
}
}
},
"description" : "vdns_onap_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id", "vdns_vf_module_id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vdns_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
}
}
},
"description" : "vdns_vf_module_id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"default" : {
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
},
- "aai-data" : {
+ "rest" : {
"type" : "source-rest",
"properties" : {
"verb" : "GET",
"description" : "vf-module-id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
"description" : "vf-module-label",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vf-module-model-customization-uuid",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
}
}
},
+ "vf-module-name" : {
+ "tags" : "vf-module-name",
+ "name" : "vf-module-name",
+ "property" : {
+ "description" : "vf-module-name",
+ "type" : "string"
+ },
+ "group" : "default",
+ "updated-by" : "Singal, Kapil <ks220y@att.com>",
+ "sources" : {
+ "input" : {
+ "type" : "source-input"
+ },
+ "default" : {
+ "type" : "source-default",
+ "properties" : { }
+ },
+ "sdnc" : {
+ "type" : "source-rest",
+ "properties" : {
+ "verb" : "GET",
+ "type" : "JSON",
+ "url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vf-module-name",
+ "path" : "/param/0/value",
+ "input-key-mapping" : {
+ "service-instance-id" : "service-instance-id",
+ "vnf-id" : "vnf-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "value"
+ },
+ "key-dependencies" : [ "service-instance-id", "vnf-id", "vf_module_id" ]
+ }
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vf-module-name\",\r\n \"resource-value\": \"${vf-module-name}\",\r\n \"external-key\": \"${vf-module-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VF-MODULE\",\r\n \"VNF_NAME\": \"${vnf_name}\",\r\n \"VF_MODULE_LABEL\":\"${vf-module-label}\",\r\n \"VF_MODULE_TYPE\":\"${vf-module-type}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "vnf_name" : "vnf_name",
+ "vf-module-label" : "vf-module-label",
+ "vf-module-type" : "vf-module-type",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vf-module-name" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "vnf_name", "vf-module-label", "vf-module-type", "vf-module-id" ]
+ }
+ }
+ }
+ },
"vf-module-type" : {
"tags" : "vf-module-type",
"name" : "vf-module-type",
"description" : "vf-module-type",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vf-naming-policy",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"default" : {
}
}
},
- "vf_module_name" : {
- "tags" : "vf_module_name",
- "name" : "vf_module_name",
- "property" : {
- "description" : "vf_module_name",
- "type" : "string"
- },
- "updated-by" : "Singal, Kapil <ks220y@att.com>",
- "sources" : {
- "input" : {
- "type" : "source-input"
- },
- "default" : {
- "type" : "source-default",
- "properties" : { }
- }
- }
- },
"vfccustomizationuuid" : {
"tags" : "vfccustomizationuuid",
"name" : "vfccustomizationuuid",
"description" : "vfccustomizationuuid",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vip",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vip" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
}
}
},
"description" : "vlb_int_pktgen_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
}
}
},
"description" : "vlb_int_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private1-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_int_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private1-prefix-id" ]
+ }
}
}
},
"description" : "vlb_name_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n\t\"elements\": [{\r\n\t\t\"resource-name\": \"vlb_name_0\",\r\n\t\t\"resource-value\": \"${vlb_name_0}\",\r\n\t\t\"external-key\": \"${vf-module-id}_vlb_name_0\",\r\n\t\t\"policy-instance-name\": \"${vf-naming-policy}\",\r\n\t\t\"naming-type\": \"VNFC\",\r\n\t\t\"VNF_NAME\": \"${vnf_name}\",\r\n\t\t\"NFC_NAMING_CODE\": \"${nfc-naming-code}\"\r\n\t}]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vf-naming-policy" : "vf-naming-policy",
+ "nfc-naming-code" : "nfc-naming-code",
+ "vnf_name" : "vnf_name",
+ "vf-module-id" : "vf-module-id"
+ },
+ "output-key-mapping" : {
+ "vlb_name_0" : "resource-value"
+ },
+ "key-dependencies" : [ "vf-naming-policy", "nfc-naming-code", "vnf_name", "vf-module-id" ]
+ }
}
}
},
"description" : "vlb_onap_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"vnf-id" : "vnf-id"
},
"output-key-mapping" : {
- "private2-prefix-id" : "value"
+ "vlb_onap_private_ip_0" : "value"
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vlb_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
}
}
},
"description" : "vlb_private_net_cidr",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vm-type",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vnf-id",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vnf-model-customization-uuid",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
"description" : "vnf_name",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"type" : "JSON",
"url-path" : "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name",
"path" : "/param/0/value",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
"input-key-mapping" : {
"service-instance-id" : "service-instance-id",
"vnf-id" : "vnf-id"
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "naming-resolution",
+ "verb" : "POST",
+ "type" : "JSON",
+ "headers" : {
+ "Accept" : "application/json",
+ "Content-Type" : "application/json"
+ },
+ "url-path" : "/v1/genNetworkElementName",
+ "payload" : "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vnf_name\",\r\n \"resource-value\": \"${vnf_name}\",\r\n \"external-key\": \"${vnf-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VNF\",\r\n \"AIC_CLOUD_REGION\": \"${aic-cloud-region}\"\r\n }\r\n ]\r\n}",
+ "path" : "/elements/0/resource-value",
+ "input-key-mapping" : {
+ "vnf-id" : "vnf-id",
+ "aic-cloud-region" : "aic-cloud-region",
+ "vf-naming-policy" : "vf-naming-policy"
+ },
+ "output-key-mapping" : {
+ "vnf_name" : "resource-value"
+ },
+ "key-dependencies" : [ "vnf-id", "aic-cloud-region", "vf-naming-policy" ]
+ }
}
}
},
"description" : "vnfc-model-invariant-uuid",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vnfc-model-version",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vpg_int_pktgen_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "private2-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_int_pktgen_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "private2-prefix-id" ]
+ }
}
}
},
"tags" : "vpg_name_0",
"name" : "vpg_name_0",
"property" : {
- "description" : "vlb_name_0",
+ "description" : "vpg_name_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "MALAKOV, YURIY <yuriy.malakov@att.com>",
"sources" : {
"input" : {
"description" : "vpg_onap_private_ip_0",
"type" : "string"
},
+ "group" : "default",
"updated-by" : "Singal, Kapil <ks220y@att.com>",
"sources" : {
"input" : {
},
"key-dependencies" : [ "service-instance-id", "vnf-id" ]
}
+ },
+ "rest" : {
+ "type" : "source-rest",
+ "properties" : {
+ "endpoint-selector" : "ipam-1",
+ "type" : "JSON",
+ "verb" : "POST",
+ "url-path" : "/api/ipam/prefixes/$prefix-id/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefix-id" : "management-prefix-id"
+ },
+ "output-key-mapping" : {
+ "vpg_onap_private_ip_0" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "management-prefix-id" ]
+ }
}
}
}
-}
+}
\ No newline at end of file
}
},
"execute" : {
- "type" : "component-script-executor",
+ "type" : "component-netconf-executor",
"requirements" : {
- "restconf-connection" : {
+ "netconf-connection" : {
"capability" : "restconf",
"node" : "netconf-device",
"relationship" : "tosca.relationships.ConnectsTo"
}
},
"interfaces" : {
- "ComponentScriptExecutor" : {
+ "ComponentNetconfExecutor" : {
"operations" : {
"process" : {
"inputs" : {
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput\r
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties\r
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService\r
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction\r
import org.springframework.web.client.RestTemplate\r
import com.fasterxml.jackson.annotation.JsonIgnore\r
import com.fasterxml.jackson.annotation.JsonProperty\r
-import org.apache.http.client.ClientProtocolException\r
-import java.io.IOException\r
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException\r
\r
open class ConfigDeploy : AbstractScriptComponentFunction() {\r
val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode\r
val vdns_ip: String = payloadObject.get("vdns-instance")[0].get("ip-addr").asText()\r
\r
-\r
val blueprintContext = bluePrintRuntimeService.bluePrintContext()\r
- val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "restconf-connection")\r
+ val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, "netconf-connection")\r
val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(requirement.node!!, requirement.capability!!)\r
val netconfDeviceInfo = JacksonUtils.getInstanceFromMap(capabilityProperties, NetconfDeviceInfo::class.java)\r
log.info("Waiting for 2 minutes until vLB intializes ...")\r
Thread.sleep(120000)\r
- val uri = "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances/vdns-instance/$vdns_ip"\r
+ val uri =\r
+ "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances/vdns-instance/$vdns_ip"\r
val restTemplate = RestTemplate()\r
val mapOfHeaders = hashMapOf<String, String>()\r
mapOfHeaders.put("Accept", "application/json")\r
basicAuthRestClientProperties.username = "admin"\r
basicAuthRestClientProperties.password = "admin"\r
basicAuthRestClientProperties.url = uri\r
- basicAuthRestClientProperties.additionalHeaders =mapOfHeaders\r
- val basicAuthRestClientService: BasicAuthRestClientService= BasicAuthRestClientService(basicAuthRestClientProperties)\r
+ basicAuthRestClientProperties.additionalHeaders = mapOfHeaders\r
+ val basicAuthRestClientService: BasicAuthRestClientService = BasicAuthRestClientService(basicAuthRestClientProperties)\r
try {\r
- val result: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.PUT.name, "", payload)\r
+ val result: BlueprintWebClientService.WebClientResponse<String> =\r
+ basicAuthRestClientService.exchangeResource(HttpMethod.PUT.name, "", payload)\r
print(result)\r
- basicAuthRestClientProperties.url = "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
- val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
+ basicAuthRestClientProperties.url =\r
+ "http://${netconfDeviceInfo.ipAddress}:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances"\r
+ val resultOfGet: BlueprintWebClientService.WebClientResponse<String> =\r
+ basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "")\r
print(resultOfGet)\r
- }\r
- catch (e: Exception) {\r
+ } catch (e: Exception) {\r
log.info("Caught exception trying to connect to vLB!!")\r
throw BluePrintProcessorException("${e.message}")\r
}\r
}\r
\r
class NetconfDeviceInfo {\r
+\r
@get:JsonProperty("login-account")\r
var username: String? = null\r
+\r
@get:JsonProperty("login-key")\r
var password: String? = null\r
+\r
@get:JsonProperty("target-ip-address")\r
var ipAddress: String? = null\r
+\r
@get:JsonProperty("port-number")\r
var port: Int = 0\r
+\r
@get:JsonProperty("connection-time-out")\r
var connectTimeout: Long = 5\r
+\r
@get:JsonIgnore\r
var source: String? = null\r
+\r
@get:JsonIgnore\r
var replyTimeout: Int = 5\r
+\r
@get:JsonIgnore\r
var idleTimeout: Int = 99999\r
\r
override fun toString(): String {\r
return "$ipAddress:$port"\r
}\r
- //TODO: should this be a data class instead? Is anything using the JSON serdes?\r
+\r
+ // TODO: should this be a data class instead? Is anything using the JSON serdes?\r
override fun equals(other: Any?): Boolean {\r
if (this === other) return true\r
if (javaClass != other?.javaClass) return false\r
override fun hashCode(): Int {\r
return javaClass.hashCode()\r
}\r
-}
\ No newline at end of file
+}\r
Created-By: Seaudi, Abdelmuhaimen <abdelmuhaimen.seaudi@orange.com>
Entry-Definitions: Definitions/vLB_CDS.json
Template-Tags: vLB-CDS
+Template-Name: vLB_CDS_RESTCONF
+Template-Version: 1.0.0
Content-Type: application/vnd.oasis.bpmn
\ No newline at end of file
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-blueprint-kotlin-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>CBA - Test Kotlin scripts</name>
- <description>CBA - Test Kotlin scripts</description>
+ <name>Components Model Catalog - Blueprints Model - Test Kotlin Parent</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>execution-service</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>netconf-executor</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
+ <artifactId>restconf-executor</artifactId>
+ </dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>cli-executor</artifactId>
<artifactId>kotlinx-coroutines-test</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</resource>
</resources>
<plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>validate-kotlin</id>
- <phase>validate</phase>
- <configuration>
- <target name="ktlint">
- <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
- <arg value="Scripts/kotlin/**/*.kt"/>
- </java>
- </target>
- <skip>${format.skipValidate}</skip>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <!-- Built-in formatter So that you wouldn't have to fix all style violations by hand.-->
- <id>format-kotlin</id>
- <phase>process-sources</phase>
- <configuration>
- <target name="ktlint">
- <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
- <arg value="-F"/>
- <arg value="Scripts/kotlin/**/*.kt"/>
- </java>
- </target>
- <skip>${format.skipExecute}</skip>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <id>default</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>integration-tests</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>default-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>cba-assembly-descriptor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${ccsdk.cds.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
def publishEndpoint = properties['cds.publish.endpoint'] ?: 'api/v1/blueprint-model/publish'
def throwIfPropMissing(prop) {
- value = properties[prop]
- if (!value || "".equals(value)) {
- throw new RuntimeException("Property missing: $prop")
- }
- return value
+ value = properties[prop]
+ if (!value || "".equals(value)) {
+ throw new RuntimeException("Property missing: $prop")
+ }
+ return value
}
def buildRequest(endpoint, fileName) {
- body = new MultipartBody.Builder()
- .setType(MultipartBody.FORM)
- .addFormDataPart("file",
- fileName,
- RequestBody.create(MediaType.parse('application/zip'), new File(target, fileName)))
- .build()
+ body = new MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .addFormDataPart("file",
+ fileName,
+ RequestBody.create(MediaType.parse('application/zip'), new File(target, fileName)))
+ .build()
- return new Request.Builder()
- .url("$protocol://$host:$port/$endpoint")
- .addHeader('Authorization', Credentials.basic(userName, password))
- .post(body)
- .build()
+ return new Request.Builder()
+ .url("$protocol://$host:$port/$endpoint")
+ .addHeader('Authorization', Credentials.basic(userName, password))
+ .post(body)
+ .build()
}
def logAndThrow(msg) {
- if(response) {
- log.error(response.body().string())
- }
- throw new RuntimeException(msg)
+ if(response) {
+ log.error(response.body().string())
+ }
+ throw new RuntimeException(msg)
}
response = null
try {
- def client = new OkHttpClient()
+ def client = new OkHttpClient()
- response = client.newCall(buildRequest(enrichEndpoint, cba)).execute()
- if (!response || !response.isSuccessful()) {
- logAndThrow("Failed to enrich CBA")
- }
+ response = client.newCall(buildRequest(enrichEndpoint, cba)).execute()
+ if (!response || !response.isSuccessful()) {
+ logAndThrow("Failed to enrich CBA")
+ }
- IOUtils.copy(
- response.body().byteStream(),
- new FileOutputStream(new File(target, enrichedCba))
- )
- log.info("Created enriched cba: $enrichedCba")
+ IOUtils.copy(
+ response.body().byteStream(),
+ new FileOutputStream(new File(target, enrichedCba))
+ )
+ log.info("Created enriched cba: $enrichedCba")
- response = client.newCall(buildRequest(publishEndpoint, enrichedCba)).execute()
- if (!response || !response.isSuccessful()) {
- logAndThrow("Failed to publish CBA")
- }
+ response = client.newCall(buildRequest(publishEndpoint, enrichedCba)).execute()
+ if (!response || !response.isSuccessful()) {
+ logAndThrow("Failed to publish CBA")
+ }
- log.info("CBA Deployed")
- log.info(response.body().string())
+ log.info("CBA Deployed")
+ log.info(response.body().string())
} finally {
- if (response) {
- response.close()
- }
+ if (response) {
+ response.close()
+ }
}
</source>
</configuration>
}
}
artifact(
- id = "command-template", type = "artifact-template-velocity",
+ id = "command-template",
+ type = "artifact-template-velocity",
file = "Templates/check-command-template.vtl"
)
}
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>test-blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>capability_cli</artifactId>
- <name>CBA - Test Capability CLI</name>
- <description>CBA - Test Capability CLI</description>
+ <name>Components Model Catalog - Blueprints Model - Test Blueprints - Capability CLI</name>
<dependencies>
<dependency>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>cba-assembly-descriptor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${ccsdk.cds.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>CBA - Test Blueprints</name>
- <description>CBA - Test Blueprints</description>
+ <name>Components Model Catalog - Blueprints Model - Test Blueprints</name>
<modules>
<module>capability_cli</module>
}
}
}
-}
\ No newline at end of file
+}
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.AbstractBluePrintDefinitions
class ResourceAuditDefinitions : AbstractBluePrintDefinitions() {
+
override fun serviceTemplate(): ServiceTemplate {
return defaultServiceTemplate()
}
}
fun ResourceAuditDefinitions.defaultServiceTemplate() =
- serviceTemplate(name = "resource-audit",
- version = "1.0.0",
- author = "Brinda Santh Muthuramalingam",
- tags = "brinda, tosca") {
+ serviceTemplate(
+ name = "resource-audit",
+ version = "1.0.0",
+ author = "Brinda Santh Muthuramalingam",
+ tags = "brinda, tosca"
+ ) {
- topologyTemplate {
+ topologyTemplate {
- workflow(id = "config-collect", description = "Collect the configuration for Device") {
- inputs {
- property(id = "device-id", type = BluePrintConstants.DATA_TYPE_STRING, required = true, description = "")
- property(id = "sources", type = BluePrintConstants.DATA_TYPE_LIST, required = true, description = "") {
- entrySchema(BluePrintConstants.DATA_TYPE_STRING)
- }
+ workflow(id = "config-collect", description = "Collect the configuration for Device") {
+ inputs {
+ property(id = "device-id", type = BluePrintConstants.DATA_TYPE_STRING, required = true, description = "")
+ property(id = "sources", type = BluePrintConstants.DATA_TYPE_LIST, required = true, description = "") {
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
- outputs {
- property(id = "response-data", required = true, type = BluePrintConstants.DATA_TYPE_STRING, description = "") {
- value(getNodeTemplateAttribute(nodeTemplateId = "config-collector",
- attributeId = ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA))
- }
- property(id = "status", required = true, type = BluePrintConstants.DATA_TYPE_STRING, description = "") {
- value(BluePrintConstants.STATUS_SUCCESS)
- }
+ }
+ outputs {
+ property(id = "response-data", required = true, type = BluePrintConstants.DATA_TYPE_STRING, description = "") {
+ value(
+ getNodeTemplateAttribute(
+ nodeTemplateId = "config-collector",
+ attributeId = ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA
+ )
+ )
+ }
+ property(id = "status", required = true, type = BluePrintConstants.DATA_TYPE_STRING, description = "") {
+ value(BluePrintConstants.STATUS_SUCCESS)
}
- step(id = "config-collector", target = "config-collector", description = "Collect the Configuration")
}
+ step(id = "config-collector", target = "config-collector", description = "Collect the Configuration")
+ }
- val configCollectorComponent = BluePrintTypes.nodeTemplateComponentScriptExecutor(
- id = "config-collector", description = "Config collector component") {
+ val configCollectorComponent = BluePrintTypes.nodeTemplateComponentScriptExecutor(
+ id = "config-collector",
+ description = "Config collector component"
+ ) {
- definedOperation(description = "Config Collector Operation") {
- inputs {
- type(BluePrintConstants.SCRIPT_KOTLIN)
- scriptClassReference("cba.resource.audit.functions.ConfigCollector")
- }
- outputs {
- status(getAttribute(ComponentScriptExecutor.ATTRIBUTE_STATUS))
- responseData(getAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA))
- }
+ definedOperation(description = "Config Collector Operation") {
+ inputs {
+ type(BluePrintConstants.SCRIPT_KOTLIN)
+ scriptClassReference("cba.resource.audit.functions.ConfigCollector")
+ }
+ outputs {
+ status(getAttribute(ComponentScriptExecutor.ATTRIBUTE_STATUS))
+ responseData(getAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA))
}
}
- nodeTemplate(configCollectorComponent)
}
+ nodeTemplate(configCollectorComponent)
+ }
- nodeType(BluePrintTypes.nodeTypeComponent())
- nodeType(BluePrintTypes.nodeTypeComponentScriptExecutor())
- }
\ No newline at end of file
+ nodeType(BluePrintTypes.nodeTypeComponent())
+ nodeType(BluePrintTypes.nodeTypeComponentScriptExecutor())
+ }
// Set the Attributes
setAttribute(ComponentScriptExecutor.ATTRIBUTE_STATUS, BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive())
- setAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, """{
+ setAttribute(
+ ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA,
+ """{
"port-speed" : "10MBS"
- }""".trimIndent().jsonAsJsonType())
-
+ }
+ """.trimIndent().jsonAsJsonType()
+ )
}
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
-
}
-}
\ No newline at end of file
+}
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
class PortSpeedRAProcessor : ResourceAssignmentProcessor() {
+
val log = logger(PortSpeedRAProcessor::class)
override fun getName(): String {
return "PortSpeedRAProcessor"
}
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ TODO("not implemented") // To change body of created functions use File | Settings | File Templates.
}
-}
\ No newline at end of file
+}
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>test-blueprint-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>resource-audit</artifactId>
- <name>CBA - Test Resource Audit</name>
- <description>CBA - Test Resource Audit</description>
+ <name>Components Model Catalog - Blueprints Model - Test Blueprints - Resource Audit</name>
<dependencies>
<dependency>
<version>3.1.0</version>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>cba-assembly-descriptor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${ccsdk.cds.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
* ============LICENSE_END=========================================================
*/
-
package cba.pnf.config.aai
-
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.contentFromResolvedArtifactNB
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService.WebClientResponse
class RestconfConfigDeploy : AbstractScriptComponentFunction() {
+
private val CONFIGLET_TEMPLATE_NAME = "config-assign"
private val CONFIGLET_RESOURCE_PATH = "yang-ext:mount/mynetconf:netconflist"
private val RESTCONF_SERVER_IDENTIFIER = "sdnc"
log.debug("Mounting Device : $deviceID")
restconfMountDevice(webclientService, deviceID, mountPayload, mutableMapOf("Content-Type" to "application/json"))
- //Log the current configuration for the subtree
+ // Log the current configuration for the subtree
val currentConfig: Any = restconfDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH)
log.info("Current configuration subtree : $currentConfig")
- //Apply configlet
- val result = restconfApplyDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
- storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
- mutableMapOf("Content-Type" to "application/yang.patch+json")) as WebClientResponse<*>
+ // Apply configlet
+ val result = restconfApplyDeviceConfig(
+ webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
+ storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
+ mutableMapOf("Content-Type" to "application/yang.patch+json")
+ ) as WebClientResponse<*>
val jsonResult = mapper.readTree((result.body).toString())
} else {
log.info("Device has been configured succesfully")
}
-
} catch (err: Exception) {
log.error("an error occurred while configuring device {}", err)
} finally {
- //Un mount device
+ // Un mount device
restconfUnMountDevice(webclientService, deviceID, "")
}
} catch (bpe: BluePrintProcessorException) {
}
}
-
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recover function called!")
log.info("Execution request : $executionRequest")
log.error("Exception", runtimeException)
}
-}
\ No newline at end of file
+}
* ============LICENSE_END=========================================================
*/
-
package cba.pnf.swug
import com.fasterxml.jackson.databind.node.ObjectNode
override suspend fun processNB(executionRequest: ExecutionServiceInput) {
// Extract request properties
- val model= validatedPayload(executionRequest)
+ val model = validatedPayload(executionRequest)
- log.info("Blueprint invoked for ${model.resolutionKey} for SW Upgrade : " +
- "${model.action} for sw version ${model.targetSwVersion} on pnf: ${model.deviceId}")
+ log.info(
+ "Blueprint invoked for ${model.resolutionKey} for SW Upgrade : " +
+ "${model.action} for sw version ${model.targetSwVersion} on pnf: ${model.deviceId}"
+ )
try {
val mountPayload = contentFromResolvedArtifactNB("mount-node")
Action.POST_CHECK -> processPostCheck(model)
Action.CANCEL -> processCancel(model)
}
-
} catch (err: Exception) {
log.error("an error occurred while configuring device {}", err)
} finally {
private fun validatedPayload(executionRequest: ExecutionServiceInput): SoftwareUpgradeModel {
val properties = requestPayloadActionProperty(executionRequest.actionIdentifiers.actionName + "-properties")!!.get(0)
- if(!properties?.get("pnf-id")?.textValue().isNullOrEmpty() &&
- !properties?.get("target-software-version")?.textValue().isNullOrEmpty()) {
- return SoftwareUpgradeModel(getDynamicProperties("resolution-key").asText(),
+ if (!properties?.get("pnf-id")?.textValue().isNullOrEmpty() &&
+ !properties?.get("target-software-version")?.textValue().isNullOrEmpty()
+ ) {
+ return SoftwareUpgradeModel(
+ getDynamicProperties("resolution-key").asText(),
BluePrintDependencyService.restClientService(RESTCONF_SERVER_IDENTIFIER),
properties.get("pnf-id").textValue(), properties.get("target-software-version").textValue(),
- Action.getEnumFromActionName(executionRequest.actionIdentifiers.actionName))
- }else{
+ Action.getEnumFromActionName(executionRequest.actionIdentifiers.actionName)
+ )
+ } else {
throw BluePrintException("Invalid parameters sent to CDS. Request parameters pnf-id or target-software-version missing")
}
}
private suspend fun processPreCheck(model: SoftwareUpgradeModel) {
log.debug("In PNF SW upgrade : processPreCheck")
- //Log the current configuration for the subtree
+ // Log the current configuration for the subtree
val payloadObject = getCurrentConfig(model)
- log.debug("Current sw version on pnf : ${payloadObject.get("software-upgrade")?.get("upgrade-package")?.get(0)?.get("software-version")?.asText()}")
+ log.debug(
+ "Current sw version on pnf : ${
+ payloadObject.get("software-upgrade")?.get("upgrade-package")?.get(0)?.get("software-version")?.asText()
+ }"
+ )
log.info("PNF is Healthy!")
}
private suspend fun processDownloadNESw(model: SoftwareUpgradeModel) {
log.debug("In PNF SW upgrade : processDownloadNESw")
- //Check if there is existing config for the targeted software version
+ // Check if there is existing config for the targeted software version
var downloadConfigPayload: String
if (checkIfSwReadyToPerformAction(Action.PRE_CHECK, model)) {
downloadConfigPayload = contentFromResolvedArtifactNB("configure")
- downloadConfigPayload =downloadConfigPayload.replace("%id%", model.yangId)
- }
- else {
+ downloadConfigPayload = downloadConfigPayload.replace("%id%", model.yangId)
+ } else {
downloadConfigPayload = contentFromResolvedArtifactNB("download-ne-sw")
- model.yangId=model.targetSwVersion
+ model.yangId = model.targetSwVersion
}
downloadConfigPayload = downloadConfigPayload.replace("%actionName%", Action.DOWNLOAD_NE_SW.name)
log.info("Config Payload to start download : $downloadConfigPayload")
- //Apply configlet
- restconfApplyDeviceConfig(model.client, model.deviceId, CONFIGLET_RESOURCE_PATH, downloadConfigPayload,
- mutableMapOf("Content-Type" to "application/yang.patch+json"))
+ // Apply configlet
+ restconfApplyDeviceConfig(
+ model.client, model.deviceId, CONFIGLET_RESOURCE_PATH, downloadConfigPayload,
+ mutableMapOf("Content-Type" to "application/yang.patch+json")
+ )
- //Poll PNF for Download action's progress
+ // Poll PNF for Download action's progress
checkExecution(model)
}
private suspend fun processActivateNESw(model: SoftwareUpgradeModel) {
log.debug("In PNF SW upgrade : processActivateNESw")
- //Check if the software is downloaded and ready to be activated
+ // Check if the software is downloaded and ready to be activated
if (checkIfSwReadyToPerformAction(Action.DOWNLOAD_NE_SW, model)) {
var activateConfigPayload: String = contentFromResolvedArtifactNB("configure")
activateConfigPayload = activateConfigPayload.replace("%actionName%", Action.ACTIVATE_NE_SW.name)
activateConfigPayload = activateConfigPayload.replace("%id%", model.yangId)
log.info("Config Payload to start activate : $activateConfigPayload")
- //Apply configlet
- restconfApplyDeviceConfig(model.client, model.deviceId, CONFIGLET_RESOURCE_PATH, activateConfigPayload,
- mutableMapOf("Content-Type" to "application/yang.patch+json"))
+ // Apply configlet
+ restconfApplyDeviceConfig(
+ model.client, model.deviceId, CONFIGLET_RESOURCE_PATH, activateConfigPayload,
+ mutableMapOf("Content-Type" to "application/yang.patch+json")
+ )
- //Poll PNF for Activate action's progress
+ // Poll PNF for Activate action's progress
checkExecution(model)
} else {
throw BluePrintRetryException("Software Download not completed for device(${model.deviceId}) to activate sw version: ${model.targetSwVersion}")
private suspend fun processPostCheck(model: SoftwareUpgradeModel) {
log.info("In PNF SW upgrade : processPostCheck")
- //Log the current configuration for the subtree
+ // Log the current configuration for the subtree
if (checkIfSwReadyToPerformAction(Action.POST_CHECK, model)) {
log.info("PNF is healthy post activation!")
}
}
- private fun processCancel(model :SoftwareUpgradeModel) {
- //This is for future implementation of cancel step during software upgrade
+ private fun processCancel(model: SoftwareUpgradeModel) {
+ // This is for future implementation of cancel step during software upgrade
log.info("In PNF SW upgrade : processCancel")
}
- private suspend fun getCurrentConfig(model: SoftwareUpgradeModel) : ObjectNode{
- val currentConfig: BlueprintWebClientService.WebClientResponse<String> = restconfDeviceConfig(model.client, model.deviceId, CONFIGLET_RESOURCE_PATH)
+ private suspend fun getCurrentConfig(model: SoftwareUpgradeModel): ObjectNode {
+ val currentConfig: BlueprintWebClientService.WebClientResponse<String> =
+ restconfDeviceConfig(model.client, model.deviceId, CONFIGLET_RESOURCE_PATH)
return JacksonUtils.jsonNode(currentConfig.body) as ObjectNode
}
+
private suspend fun checkExecution(model: SoftwareUpgradeModel) {
val checkExecutionBlock: suspend (Int) -> String = {
val result = restconfDeviceConfig(model.client, model.deviceId, TARGET_SOFTWARE_PATH.plus(model.yangId))
}
}
model.client.retry<String>(10, 0, 1000, checkExecutionBlock)
-
}
- private suspend fun checkIfSwReadyToPerformAction(action : Action, model: SoftwareUpgradeModel): Boolean {
+ private suspend fun checkIfSwReadyToPerformAction(action: Action, model: SoftwareUpgradeModel): Boolean {
val configBody = getCurrentConfig(model)
configBody.get("software-upgrade")?.get("upgrade-package")?.iterator()?.forEach { item ->
if (model.targetSwVersion == item.get("software-version")?.asText() &&
- action.completionStatus == item?.get("current-status")?.asText()) {
- model.yangId= item.get("id").textValue()
+ action.completionStatus == item?.get("current-status")?.asText()
+ ) {
+ model.yangId = item.get("id").textValue()
return true
}
}
POST_CHECK("postCheck", "ACTIVATION_COMPLETED"),
CANCEL("cancel", "CANCELLED")
;
- companion object{
+
+ companion object {
+
fun getEnumFromActionName(name: String): Action {
- for(value in values()){
- if (value.actionName==name) return value
+ for (value in values()) {
+ if (value.actionName == name) return value
}
throw BluePrintException("Invalid Action sent to CDS")
}
}
}
-data class SoftwareUpgradeModel(val resolutionKey: String, val client: BlueprintWebClientService, val deviceId: String,
- val targetSwVersion: String, val action: Action, var yangId: String = "")
\ No newline at end of file
+data class SoftwareUpgradeModel(
+ val resolutionKey: String,
+ val client: BlueprintWebClientService,
+ val deviceId: String,
+ val targetSwVersion: String,
+ val action: Action,
+ var yangId: String = ""
+)
* ============LICENSE_END=========================================================
*/
-
package cba.pnf.config
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.controllerblueprints.core.logger
class RestconfConfigDeploy : AbstractScriptComponentFunction() {
+
private val CONFIGLET_TEMPLATE_NAME = "config-assign"
private val CONFIGLET_RESOURCE_PATH = "yang-ext:mount/mynetconf:netconflist"
private val RESTCONF_SERVER_IDENTIFIER = "sdnc"
log.debug("Mounting Device : $deviceID")
restconfMountDevice(webclientService, deviceID, mountPayload, mutableMapOf("Content-Type" to "application/json"))
- //Log the current configuration for the subtree
+ // Log the current configuration for the subtree
val currentConfig: Any = restconfDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH)
log.info("Current configuration subtree : $currentConfig")
- //Apply configlet
- restconfApplyDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
- storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
- mutableMapOf("Content-Type" to "application/yang.patch+json"))
-
+ // Apply configlet
+ restconfApplyDeviceConfig(
+ webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
+ storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
+ mutableMapOf("Content-Type" to "application/yang.patch+json")
+ )
} catch (err: Exception) {
log.error("an error occurred while configuring device {}", err)
} finally {
- //Un mount device
+ // Un mount device
restconfUnMountDevice(webclientService, deviceID, "")
}
} catch (bpe: BluePrintProcessorException) {
}
}
-
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recover function called!")
log.info("Execution request : $executionRequest")
log.error("Exception", runtimeException)
}
-}
\ No newline at end of file
+}
"required": false,
"type": "string"
},
+ "artifact-prefix-names": {
+ "description": "Resource Assignment Artifact Prefix names",
+ "required": false,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
"resource-assignment-map": {
"description": "Holds resolved values for each artifact prefix eg. { vdns: { vnf-id: 123 } }",
"required": false,
"default": 30
}
}
+ },
+ "restconf" : {
+ "type": "tosca.capabilities.Restconf",
+ "properties" : {
+ "login-key": {
+ "required": true,
+ "type": "string"
+ },
+ "login-account": {
+ "required": true,
+ "type": "string"
+ },
+ "target-ip-address": {
+ "required": true,
+ "type": "string"
+ },
+ "port-number": {
+ "required": true,
+ "type": "integer"
+ },
+ "connection-time-out": {
+ "required": false,
+ "type": "integer",
+ "default": 30
+ }
+ }
}
},
"derived_from": "tosca.nodes.Vnf"
+++ /dev/null
-{
- "tags": "vpg_name_0",
- "name": "vpg_name_0",
- "group":"default",
- "property": {
- "description": "vpg_name_0",
- "type": "string"
- },
- "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
- "sources": {
- "input": {
- "type": "source-input"
- },
- "default": {
- "type": "source-default",
- "properties": {}
- },
- "sdnc": {
- "type": "source-rest",
- "properties": {
- "verb": "GET",
- "type": "JSON",
- "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vpg_name_0",
- "path": "/param/0/value",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "vnf-id": "vnf-id"
- },
- "output-key-mapping": {
- "vpg_name_0": "value"
- },
- "key-dependencies": [
- "service-instance-id",
- "vnf-id"
- ]
- }
- }
- }
-}
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-aggregator</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
- <artifactId>components</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-components</artifactId>
<packaging>pom</packaging>
- <name>Components Root</name>
- <description>Components</description>
+ <name>Components (Root)</name>
<modules>
+ <module>cba-parent</module>
<module>model-catalog/blueprint-model</module>
</modules>
</project>
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0
-.. International License. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-.. _cds_cba-doc:
-
-Controller Blueprint Archived Designer Tool(CBA)
-================================================
-.. toctree::
- :maxdepth: 1
-
-Introduction
-------------
-The Controller Blueprint Archived is the overall service design, fully
-model-driven, package needed to automate the resolution of resources for
-instantiation and any config provisioning operation, such as day0,
-day1 or day2 configuration.
-
-The CBA is .zip file, comprised of the following folder structure, the
-files may vary:
-
-|image0|
-
-
-Architecture
-------------
-
-|image3|
-
-
-Installation
-------------
-
-Building client html and js files
-.................................
-
- * FROM alpine:3.8 as builder
- * RUN apk add --no-cache npm
- * WORKDIR /opt/cds-ui/client/
- * COPY client/package.json /opt/cds-ui/client/
- * RUN npm install
- * COPY client /opt/cds-ui/client/
- * RUN npm run build
-
-Building and creating server
-............................
-
- * FROM alpine:3.8
- * WORKDIR /opt/cds-ui/
- * RUN apk add --no-cache npm
- * COPY server/package.json /opt/cds-ui/
- * RUN npm install
- * COPY server /opt/cds-ui/
- * COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public
- * RUN npm run build
- * EXPOSE 3000
- * CMD [ "npm", "start" ]
-
-Development
------------
-
-Pre-requiste
-............
- * Visual Studio code editor
- * Git bash
- * Node.js & npm
- * loopback 4 cl
-
-Steps
-.....
- To compile CDS code:
-
- 1. Make sure your local Maven settings file ($HOME/.m2/settings.xml)
- contains references to the ONAP repositories and OpenDaylight
- repositories.
- 2. git clone https://(LFID)@gerrit.onap.org/r/a/ccsdk/cds
- 3. cd cds ; mvn clean install ; cd ..
- 4. Open the cds-ui/client code for development
-
-Functional Decomposition
-------------------------
-|image2|
-
-.. |image0| image:: media/image0.jpg
- :width: 7.88889in
- :height: 4.43750in
-
-.. |image2| image:: media/image2.jpg
- :width: 7.88889in
- :height: 4.43750in
-
-.. |image3| image:: media/CDS_architecture.jpg
- :height: 4.43750in
- :width: 7.88889in
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0
+.. International License. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+.. _cds_cba-doc:
+
+Controller Blueprint Archived Designer Tool (CBA)
+=================================================
+.. toctree::
+ :maxdepth: 1
+
+Introduction
+------------
+The **C**\ ontroller **B**\ lueprint **A**\ rchive is the overall service design, fully model-driven, intent based
+**package** needed for SELF SERVICE provisioning and configuration management automation.
+
+The CBA is **.zip** file, comprised of the following folder structure, the files may vary:
+
+.. code-block language is required for ReadTheDocs to render code-blocks. Python set as default.
+
+.. code-block:: python
+
+ ├── Definitions
+ │ ├── blueprint.json Overall TOSCA service template (workflow + node_template)
+ │ ├── artifact_types.json (generated by enrichment)
+ │ ├── data_types.json (generated by enrichment)
+ │ ├── policy_types.json (generated by enrichment)
+ │ ├── node_types.json (generated by enrichment)
+ │ ├── relationship_types.json (generated by enrichment)
+ │ ├── resources_definition_types.json (generated by enrichment, based on Data Dictionaries)
+ │ └── *-mapping.json One per Template
+ │
+ ├── Environments Contains *.properties files as required by the service
+ │
+ ├── Plans Contains Directed Graph
+ │
+ ├── Tests Contains uat.yaml file for testing cba actions within a cba package
+ │
+ ├── Scripts Contains scripts
+ │ ├── python Python scripts
+ │ └── kotlin Kotlin scripts
+ │
+ ├── TOSCA-Metadata
+ │ └── TOSCA.meta Meta-data of overall package
+ │
+ └── Templates Contains combination of mapping and template
+
+To process a CBA for any service we need to enrich it first. This will gather all the node- type, data-type,
+artifact-type, data-dictionary definitions provided in the blueprint.json.
+
+
+Architecture
+------------
+|image1|
+
+
+Data Flow
+---------
+|image2|
+
+
+Installation
+------------
+
+Building client html and js files
+.................................
+
+ * FROM alpine:3.8 as builder
+ * RUN apk add --no-cache npm
+ * WORKDIR /opt/cds-ui/client/
+ * COPY client/package.json /opt/cds-ui/client/
+ * RUN npm install
+ * COPY client /opt/cds-ui/client/
+ * RUN npm run build
+
+Building and creating server
+............................
+
+ * FROM alpine:3.8
+ * WORKDIR /opt/cds-ui/
+ * RUN apk add --no-cache npm
+ * COPY server/package.json /opt/cds-ui/
+ * RUN npm install
+ * COPY server /opt/cds-ui/
+ * COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public
+ * RUN npm run build
+ * EXPOSE 3000
+ * CMD [ "npm", "start" ]
+
+
+Development
+-----------
+
+Pre-requiste
+............
+ * Visual Studio code editor
+ * Git bash
+ * Node.js & npm
+ * loopback 4 cl
+
+Steps
+.....
+ To compile CDS code:
+
+ 1. Make sure your local Maven settings file ($HOME/.m2/settings.xml)
+ contains references to the ONAP repositories and OpenDaylight
+ repositories.
+ 2. git clone https://(LFID)@gerrit.onap.org/r/a/ccsdk/cds
+ 3. cd cds ; mvn clean install ; cd ..
+ 4. Open the cds-ui/client code for development
+
+
+Functional Decomposition
+------------------------
+|image3|
+
+.. |image1| image:: media/CDS_Architecture.jpg
+ :width: 500pt
+
+.. |image2| image:: media/CDS_Data_Flow.jpg
+ :width: 500pt
+
+.. |image3| image:: media/Functional_Decomposition.jpg
+ :width: 500pt
+
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-complex Response code
-=====================
-
-.. code-block:: json
- :linenos:
-
- {
- "id": 4,
- "address": "192.168.10.2/32",
- "vrf": null,
- "tenant": null,
- "status": 1,
- "role": null,
- "interface": null,
- "description": "",
- "nat_inside": null,
- "created": "2018-08-30",
- "last_updated": "2018-08-30T14:59:05.277820Z"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-create_netbox_ip_address code
-=============================
-
-.. code-block:: json
-
- {
- "tags" : "oam-local-ipv4-address",
- "name" : "create_netbox_ip",
- "property" : {
- "description" : "netbox ip",
- "type" : "dt-netbox-ip"
- },
- "updated-by" : "adetalhouet",
- "sources" : {
- "config-data" : {
- "type" : "source-rest",
- "properties" : {
- "type" : "JSON",
- "verb" : "POST",
- "endpoint-selector" : "ipam-1",
- "url-path" : "/api/ipam/prefixes/$prefixId/available-ips/",
- "path" : "",
- "input-key-mapping" : {
- "prefixId" : "prefix-id"
- },
- "output-key-mapping" : {
- "address" : "address",
- "id" : "id"
- },
- "key-dependencies" : [ "prefix-id" ]
- }
- }
- }
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Dbsystemcode
-============
-.. code-block:: json
- :linenos:
-
- {
- "dsl_definitions": {
- "dynamic-db-source": {
- "type": "maria-db",
- "url": "jdbc:mysql://localhost:3306/sdnctl",
- "username": "<username>",
- "password": "<password>"
- }
- }
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-dt-netbox-ip code
-=================
-
-.. code-block:: none
- :linenos:
-
- {
- "version": "1.0.0",
- "description": "This is Netbox IP Data Type",
- "properties": {
- "address": {
- "required": true,
- "type": "string"
- },
- "id": {
- "required": true,
- "type": "integer"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Source Capability Code
-======================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Component Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "script-type": {
- "required": true,
- "type": "string",
- "default": "kotlin",
- "constraints": [
- {
- "valid_values": [
- "kotlin",
- "jython"
- ]
- }
- ]
- },
- "script-class-reference": {
- "description": "Capability reference name for internal and kotlin, for jython script file path",
- "required": true,
- "type": "string"
- },
- "instance-dependencies": {
- "required": false,
- "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "key-dependencies": {
- "description": "Resource Resolution dependency dictionary names.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Resource Source
----------------
-
-Input:
-======
-Expects the value to be provided as input to the request.
-
-
-.. code-block:: json
- :linenos:
-
- {
- "source-input" :
- {
- "description": "This is Input Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
- }
- }
-
-
-
-Default:
-========
-Expects the value to be defaulted in the model itself.
-
-
-.. code-block:: json
- :linenos:
-
- {
- "source-default" :
- {
- "description": "This is Default Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
- }
- }
-
-
-sql:
-====
-
-Expects the SQL query to be modeled; that SQL query can be parameterized, and the parameters be other resources resolved through other means. If that's the case, this data dictionary definition will have to define key-dependencies along with input-key-mapping.
-
-CDS is currently deployed along the side of SDNC, hence the primary database connection provided by the framework is to SDNC database.
-
-|image0|
-
-.. |image0| image:: media/sqltable.JPG
- :width: 7.88889in
- :height: 4.43750in
-
-.. toctree::
- :maxdepth: 1
-
- sourceprimarydbcode
-
-Connection to a specific database can be expressed through the endpoint-selector property, which refers to a macro defining the information about the database the connect to. Understand TOSCA Macro in the context of CDS.
-
-.. toctree::
- :maxdepth: 1
-
- dbsystemcode
-
-
-REST:
-=====
-
-Expects the URI along with the VERB and the payload, if needed.
-
-CDS is currently deployed along the side of SDNC, hence the default rest connection provided by the framework is to SDNC MDSAL.
-
-|image1|
-
-.. |image1| image:: media/resttable.JPG
- :width: 7.88889in
- :height: 4.43750in
-
-.. toctree::
- :maxdepth: 1
-
- restsourcecode
-
-Connection to a specific REST system can be expressed through the endpoint-selector property, which refers to a macro defining the information about the REST system the connect to. Understand TOSCA Macro in the context of CDS.
-
-Few ways are available to authenticate to the REST system:
-
- * token-auth
- * basic-auth
- * ssl-basic-auth
-
-For source code of Authentication click below link:
-
-.. toctree::
- :maxdepth: 1
-
- restauth
-
-Capability:
-===========
-
-Expects a script to be provided.
-
-|image2|
-
-.. |image2| image:: media/capabilitytable.JPG
- :width: 7.88889in
- :height: 4.43750in
-
-
-.. toctree::
- :maxdepth: 1
-
- sourcecapabilitycode
-
-Complex Type:
-=============
-
-Value will be resolved through REST., and output will be a complex type.
-
-Modeling reference: Modeling Concepts#rest
-
-In this example, we're making a POST request to an IPAM system with no payload.
-
-Some ingredients are required to perform the query, in this case, $prefixId. Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding.
-
-As part of this request, the expected response will be as below.
-
-.. toctree::
- :maxdepth: 1
-
- complexResponse
-
-What is of interest is the address and id fields. For the process to return these two values, we need to create a custom data-type, as bellow
-
-.. toctree::
- :maxdepth: 1
-
- dt-netbox-ip
-
-The type of the data dictionary will be dt-netbox-ip.
-
-To tell the resolution framework what is of interest in the response, the output-key-mapping section is used. The process will map the output-key-mapping to the defined data-type.
-
-.. toctree::
- :maxdepth: 1
-
- create_netbox_ip_address
\ No newline at end of file
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-
-Resource Rest Authentication
-----------------------------
-
-token-auth:
-~~~~~~~~~~~
-
-.. code-block:: json
- :linenos:
-
- {
- "dsl_definitions": {
- "dynamic-rest-source": {
- "type" : "token-auth",
- "url" : "http://localhost:32778",
- "token" : "<token>"
- }
- }
- }
-
-basic-auth:
-~~~~~~~~~~~
-
-.. code-block:: json
- :linenos:
-
- {
- "dsl_definitions": {
- "dynamic-rest-source": {
- "type" : "basic-auth",
- "url" : "http://localhost:32778",
- "username" : "<username>",
- "password": "<password>"
- }
- }
- }
-
-ssl-basic-auth:
-~~~~~~~~~~~~~~~
-
-.. code-block:: json
- :linenos:
-
- {
- "dsl_definitions": {
- "dynamic-rest-source": {
- "type" : "ssl-basic-auth",
- "url" : "http://localhost:32778",
- "keyStoreInstance": "JKS or PKCS12",
- "sslTrust": "trusture",
- "sslTrustPassword": "<password>",
- "sslKey": "keystore",
- "sslKeyPassword": "<password>"
- }
- }
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Rest Source Code:
-=================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Rest Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "JSON",
- "constraints": [
- {
- "valid_values": [
- "JSON"
- ]
- }
- ]
- },
- "verb": {
- "required": false,
- "type": "string",
- "default": "GET",
- "constraints": [
- {
- "valid_values": [
- "GET", "POST", "DELETE", "PUT"
- ]
- }
- ]
- },
- "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",
- "default": "JSON_PATH",
- "constraints": [
- {
- "valid_values": [
- "JSON_PATH",
- "JSON_POINTER"
- ]
- }
- ]
- },
- "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"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Source Capability Code
-======================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Component Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "script-type": {
- "required": true,
- "type": "string",
- "default": "kotlin",
- "constraints": [
- {
- "valid_values": [
- "kotlin",
- "jython"
- ]
- }
- ]
- },
- "script-class-reference": {
- "description": "Capability reference name for internal and kotlin, for jython script file path",
- "required": true,
- "type": "string"
- },
- "key-dependencies": {
- "description": "Resource Resolution dependency dictionary names.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
- }
-
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Source Default code
-===================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Default Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Source Input code
-=================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Input Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
- }
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Source Primary DB Code:
-=======================
-
-.. code-block:: json
- :linenos:
-
- {
- "description": "This is Database Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "SQL"
- ]
- }
- ]
- },
- "endpoint-selector": {
- "required": false,
- "type": "string"
- },
- "query": {
- "required": true,
- "type": "string"
- },
- "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"
- }
Introduction
------------
-The system is designed to be self service, which means that users, not just
+ The system is designed to be self service, which means that users, not just
programmers, can reconfigure the software system as needed to meet customer
requirements. To accomplish this goal, the system is built around models that
provide for real-time changes in how the system operates. Users merely need
to change a model to change how a service operates.
-Self service is a completely new way of delivering services. It removes the
+
+ Self service is a completely new way of delivering services. It removes the
dependence on code releases and the delays they cause and puts the control of
services into the hands of the service providers. They can change a model and
its parameters and create a new service without writing a single line of code.
* The GUI (or frontend)
* The Run Time (or backend)
-The GUI handles direct user input and allows for displaying both design time
+ The GUI handles direct user input and allows for displaying both design time
and run time activities. For design time, it allows for the creation of
controller blueprint, from selecting the DGs to be included, to incorporating
the artifact templates, to adding necessary components. For run time, it
allows the user to direct the system to resolve the unresolved elements of the
controller blueprint and download the resulting configuration into a VNF.
-At a more basic level, it allows for creation of data dictionaries,
+
+ At a more basic level, it allows for creation of data dictionaries,
capabilities catalogs, and controller blueprint, the basic elements that are
used to generate a configuration. The essential function of the Controller
Design Studio is to create and populate a controller blueprint, create a
Modeling Concept
----------------
-In Dublin release, the CDS community has contributed a framework to automate
+ In Dublin release, the CDS community has contributed a framework to automate
the resolution of resources for instantiation and any config provisioning
operation, such as day0, day1 or day2 configuration.
-The content of the CBA Package is driven from a catalog of reusable data
+ The content of the CBA Package is driven from a catalog of reusable data
dictionary, component and workflow, delivering a reusable and simplified
self service experience.
Tosca Model Reference:
-|image0|
+|toscaModel|
Modeling Concept Links:
~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
- modelingconcepts/overview
- microservices/controllerBlueprintStudioProcessorMS
- microservices/bluePrintsProcessorMS
- microservices/expression
- microservices/dynamicapi
- microservices/flexibleplugin
-
-
-Design tools
-------------
-.. toctree::
- :maxdepth: 1
- :glob:
-
- CBA/index
- datadictionary/index
+ modelingconcepts/index
+ microservices/controllerBlueprintMS
+ microservices/blueprintsProcessorMS
Scripts
-------
* NetconfClient
-In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available. This NetconfClient can be used when using the component-netconf-executor.
+ In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available. This NetconfClient can be used when using the component-netconf-executor.
-The client can be find here: https://github.com/onap/ccsdk-cds/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py
+ The client can be find here: https://github.com/onap/ccsdk-cds/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py
* ResolutionHelper
-When executing a component executor script, designer might want to perform
-resource resolution along with template meshing directly from the script
-itself.
+ When executing a component executor script, designer might want to perform
+ resource resolution along with template meshing directly from the script
+ itself.
-The helper can be found in below link:
-https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/common.py
+ The helper can be found in below link:
+ https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/common.py
-.. |image0| image:: media/tosca_model.jpg
- :width: 7.88889in
- :height: 4.43750in
+.. |toscaModel| image:: media/tosca_model.jpg
+ :width: 500pt
-.. |cdsArchitectureImage| image:: media/CDS_architecture_latest.png
- :scale: 30 %
+.. |cdsArchitectureImage| image:: media/CDS_architecture.jpg
+ :width: 500pt
-Developer Guide
+User Guide
----------
.. toctree::
- :maxdepth: 1
+ :maxdepth: 3
- developerguide/developer-guide
+ userguide/developer-guide
+ userguide/installation
+ userguide/designtime
-User Guide
-----------
+Use Cases
+---------
.. toctree::
- :maxdepth: 1
+ :maxdepth: 2
- installation
- designtime
+ usecases/use-cases
-CDS Desginer UI
+CDS Designer UI
---------------
.. toctree::
- :maxdepth: 1
+ :maxdepth: 2
- CDS_Designer_Guide
+ ui/designer
Controller Design Studio Presentation
-------------------------------------
Details about CDS Architecture and Design detail, Please click the link.
-:download:`CDS_Architecture_Design.pptx`
+:download:`CDS_Architecture_Design <media/CDS_Architecture_Design.pptx>`
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Logging
--------
-.. toctree::
- :maxdepth: 1
-
-CCSDK uses slf4j to log messages to the standard OpenDaylight karaf.log
-log file.
-
-Where to Access Information
----------------------------
-Logs are found within the SDNC docker container, in the directory
-/opt/opendaylight/current/data/logs.
\ No newline at end of file
.. toctree::
:maxdepth: 1
:titlesonly:
-
+
Micro service to Manage Controller Blueprint Models, such as Resource Dictionary, Service Models, Velocity Templates etc, which will serve service for Controller Design Studio and Controller runtimes.
This microservice is used to deploy Controller Blueprint Archive file in Run time database. This also helps to test the Valid Blueprint.
|image0|
-.. |image0| image:: images/blueprintprocessor.jpg
- :height: 600px
- :width: 800px
-
+.. |image0| image:: media/blueprintprocessor.jpg
+ :width: 400pt
+
Running Blueprints Processor Microservice Locally:
--------------------------------------------------
In the checked out directory, type
.. code-block:: none
-
- mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
-
+
+ mvn clean install -Pq -Dadditionalparam=-Xdoclint:none
+
Create the needed Docker images:
The Blueprints Processor microservice project has a module, called distribution, that provides a docker-compose.yaml file that can be used to spin up Docker containers to run this microservice.
.. code-block:: none
cd ms/blueprintsprocessor/distribution/
-
+
Build it using the Maven profile called Docker:
.. code-block:: none
mvn clean install -Pdocker
-
+
+
Start Docker containers using docker-composer:
----------------------------------------------
Navigate to the docker-compose file in the distribution module:
.. code-block:: none
-
+
cd src/main/dc/
-
+
From there, start the containers:
.. code-block:: none
docker-compose up -d
-
+
This will spin the Docker containers declared inside the docker-compose.yaml file in the background.
.. code-block:: none
docker-compose logs -f
-
-
+
+
Testing the environment:
------------------------
Controller Blueprints Studio Processor
======================================
-The Controller Blueprint Archive is the overall service design, fully model-driven, intent based package needed for SELF SERVICE provisioning and configuration management automation.
+The **C**\ ontroller **B**\ lueprint **A**\ rchive is the overall service design, fully model-driven, intent based
+**package** needed for SELF SERVICE provisioning and configuration management automation.
+
+The CBA is .zip file, which is saved in Controller Blueprint Database.
-The CBA is .zip file which is saved in Controller Blueprint Database.
Controller Blueprint Microservices:
-----------------------------------
.. toctree::
:maxdepth: 1
-
+
dynamicapi
enrichment
-
\ No newline at end of file
.. Copyright (C) 2019 IBM.
Dynamic API
------------
+===========
The nature of the API request and response is meant to be model driven and dynamic. They both share the same definition.
|image0|
.. |image0| image:: media/dyanmicapi.jpg
- :height: 4.43750in
- :width: 7.88889in
\ No newline at end of file
+ :width: 500pt
\ No newline at end of file
REST API request:
-----------------
-
|image0|
CDS UI:
-------
-
|image1|
-
|image2|
.. |image0| image:: media/Enrichment-REST.png
- :width: 7.88889in
- :height: 4.43750in
-
+ :width: 500pt
+
.. |image1| image:: media/Enrichment-UI1.png
- :width: 7.88889in
- :height: 4.43750in
-
+ :width: 500pt
+
.. |image2| image:: media/Enrichment-UI2.png
- :width: 7.88889in
- :height: 4.43750in
\ No newline at end of file
+ :width: 500pt
\ No newline at end of file
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0
-.. International License. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Expression
-==========
-
-TOSCA provides for a set of functions to reference elements within the template or to retrieve runtime values.
-
-Below is a list of supported expressions
-
-get_input
----------
-
-The get_input function is used to retrieve the values of properties declared within the inputs section of a TOSCA Service Template.
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178
-
-get_property
-------------
-
-The get_property function is used to retrieve property values between modelable entities defined in the same service template.
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178
-
-get_attribute
--------------
-
-The get_attribute function is used to retrieve the values of named attributes declared by the referenced node or relationship template name.
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454179
-
-get_operation_output
---------------------
-
-The get_operation_output function is used to retrieve the values of variables exposed / exported from an interface operation.
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454180
-
-get_artifact
-------------
-
-The get_artifact function is used to retrieve artifact location between modelable entities defined in the same service template.
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454182
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2019 IBM.
-
-Flexible Plug-in
-----------------
-
-Interaction with external systems is made plug-able, removing development cycle to support new endpoint.
-
-Currently, REST or SQL external systems are supported.
-
-An external system might be used by multiple resources, or by multiple scripts.
-
-In order to share the external system information, TOSCA provides a way to create macros using dsl_definitions:
-
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454160
-http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454173
Workflow
========
-
A workflow defines an overall action to be taken on the service, hence is an entry-point for the run-time execution of the CBA package.
A workflow also defines inputs and outputs that will defined the payload contract of the request and response (see Dynamic API)
A CBA package can have as many workflows as needed.
+
Single action
-------------
-
The workflow is directly backed by a node_template of type tosca.nodes.Component
+
Multiple sub-actions
--------------------
The workflow is backed by Directed Graph engine, node_template of type dg-generic, and are imperative workflows.
Below the properties of a workflow:
-
Workflow Example
----------------
-
-::
+.. code-block:: json
{
"workflow": {
"required": true,
"type": "string"
},
- "resource-assignment-properties": { <- dynamic inputs
+ "resource-assignment-properties": { <- dynamic inputs
"required": true,
"type": "dt-resource-assignment-properties"
}
.. _artifact_type:
Artifact Type
--------------------------------------
+-------------
-Represents the **type of a artifact**, used to **identify** the
+Represents the **type of a artifact**, used to **identify** the
**implementation** of the functionality supporting this type of artifact.
`TOSCA definition <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454213>`_
This node was created, derived from ``tosca.artifacts.Root`` to be the root TOSCA node for all artifact.
-.. code-block:: JSON
+.. code-block:: json
:caption: **tosca.artifacts.Implementation**
{
- "description": "TOSCA base type for implementation artifacts",
- "version": "1.0.0",
- "derived_from": "tosca.artifacts.Root"
+ "description": "TOSCA base type for implementation artifacts",
+ "version": "1.0.0",
+ "derived_from": "tosca.artifacts.Root"
}
**Bellow is a list of supported artifact types**
File must have **.vtl** extension.
- The **template** can represent anything, such as device config, payload to interact with 3rd party systems,
+ The **template** can represent anything, such as device config, payload to interact with 3rd party systems,
:ref:`resource-accumulator template`, etc...
- Often a template will be **parameterized**, and each **parameter**
+ Often a template will be **parameterized**, and each **parameter**
must be defined within an mapping file (see 'Mapping' in this tab).
`Velocity reference document <http://velocity.apache.org/engine/1.7/user-guide.html>`_
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-velocity.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-velocity.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-template-velocity**
{
- "description": "TOSCA base type for implementation artifacts",
- "version": "1.0.0",
- "derived_from": "tosca.artifacts.Root"
+ "description": "TOSCA base type for implementation artifacts",
+ "version": "1.0.0",
+ "derived_from": "tosca.artifacts.Root"
}
.. tab:: Jinja
File must have **.jinja** extension.
- The **template** can represent **anything**, such as device config,
+ The **template** can represent **anything**, such as device config,
payload to interact with 3rd party systems, :ref:`resource-accumulator template`, etc...
Often a template will be parameterized, and each parameter must be defined within an :ref:`mapping file`.
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-template-jinja**
{
- "description": " Jinja Template used for Configuration",
- "version": "1.0.0",
- "file_ext": [
+ "description": " Jinja Template used for Configuration",
+ "version": "1.0.0",
+ "file_ext": [
"jinja"
- ],
- "derived_from": "tosca.artifacts.Implementation"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
}
.. tab:: Mapping
This type is meant to represent **mapping** files defining the **contract of each resource** to be resolved.
- Each **parameter** in a template **must** have a corresponding mapping definition,
+ Each **parameter** in a template **must** have a corresponding mapping definition,
modeled using datatype-resource-assignment (see :ref:`data_type`-> resources-asignment).
Hence the mapping file is meant to be a list of entries defined using datatype-resource-assignment
File must have **.json** extension.
- The **template** can represent **anything**, such as device config,
+ The **template** can represent **anything**, such as device config,
payload to interact with 3rd party systems, resource-accumulator template, etc...
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-mapping-resource.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-mapping-resource**
{
- "description": "Resource Mapping File used along with Configuration template",
- "version": "1.0.0",
- "file_ext": [
+ "description": "Resource Mapping File used along with Configuration template",
+ "version": "1.0.0",
+ "file_ext": [
"json"
- ],
- "derived_from": "tosca.artifacts.Implementation"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
}
-
- The mapping file basically contains a reference to the data dictionary to use
+
+ The mapping file basically contains a reference to the data dictionary to use
to resolve a particular resource.
The data dictionary defines the HOW and the mapping defines the WHAT.
Below are two examples using color coding to help understand the relationships.
- In orange is the information regarding the template. As mentioned before,
- template is part of the blueprint itself, and for the blueprint to know what template to use,
+ In orange is the information regarding the template. As mentioned before,
+ template is part of the blueprint itself, and for the blueprint to know what template to use,
the name has to match.
- In green is the relationship between the value resolved within the template,
+ In green is the relationship between the value resolved within the template,
and how it's mapped coming from the blueprint.
In blue is the relationship between a resource mapping to a data dictionary.
In red is the relationship between the resource name to be resolved and the HEAT environment variables.
- The key takeaway here is that whatever the value is for each color, it has to match all across.
- This means both right and left hand side are equivalent; it's all on the designer to express
+ The key takeaway here is that whatever the value is for each color, it has to match all across.
+ This means both right and left hand side are equivalent; it's all on the designer to express
the modeling for the service. That said, best practice is example 1.
- .. image:: ../media/dd_mapping_template_rel.png
- :scale: 100 %
+ .. image:: ../media/dd_mapping_template_rel.jpg
+ :width: 500pt
:align: center
.. tab:: Directed Graph
File must have **.xml** extension.
- Here is the list of executors currently supported (see here for explanation and full potential list:
+ Here is the list of executors currently supported (see here for explanation and full potential list:
`Service Logic Interpreter Nodes <https://wiki.onap.org/display/DW/Service+Logic+Interpreter+Nodes>`_
* execute
* block
* return
* break
- * exit
+ * exit
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-directed-graph.json>`_
is the TOSCA artifact type:
:caption: **artifact-directed-graph**
{
- "description": "Directed Graph File",
- "version": "1.0.0",
- "file_ext": [
+ "description": "Directed Graph File",
+ "version": "1.0.0",
+ "file_ext": [
"json",
"xml"
- ],
- "derived_from": "tosca.artifacts.Implementation"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
}
.. This work is licensed under a Creative Commons Attribution 4.0
.. International License. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2020 Deutsche Telekom AG.
+.. Copyright (C) 2020 AT&T.
.. _cba:
Controller Blueprint Archive (.cba)
--------------------------------------
+-----------------------------------
The **C**\ ontroller **B**\ lueprint **A**\ rchive is the overall service design, fully model-driven, intent based
-**package** needed for provisioning and configuration management automation.
+**package** needed for SELF SERVICE provisioning and configuration management automation.
The CBA is **.zip** file, comprised of the following folder structure, the files may vary:
.. code-block:: python
- ├── Definitions
- │ ├── blueprint.json Overall TOSCA service template (worfklow + node_template)
- │ ├── artifact_types.json (generated by enrichment)
- │ ├── data_types.json (generated by enrichment)
- │ ├── node_types.json (generated by enrichment)
- │ ├── relationship_types.json (generated by enrichment)
- │ └── resources_definition_types.json (generated by enrichment)
- ├── Environments Contains *.properties files as required by the service
- ├── Plans Contains Directed Graph
- ├── Tests Contains uat.yaml file for testing the cba actions within a cba **package
- ├── Scripts Contains scripts
- │ ├── python Python scripts
- │ └── kotlin Kotlin scripts
- ├── TOSCA-Metadata
- │ └── TOSCA.meta Meta-data of overall package
- └── Templates Contains combination of mapping and template
-
-To process a CBA for any service we need to enrich it first. This will gather all the node- type, data-type,
+ ├── Definitions
+ │ ├── blueprint.json Overall TOSCA service template (workflow + node_template)
+ │ ├── artifact_types.json (generated by enrichment)
+ │ ├── data_types.json (generated by enrichment)
+ │ ├── policy_types.json (generated by enrichment)
+ │ ├── node_types.json (generated by enrichment)
+ │ ├── relationship_types.json (generated by enrichment)
+ │ ├── resources_definition_types.json (generated by enrichment, based on Data Dictionaries)
+ │ └── *-mapping.json One per Template
+ │
+ ├── Environments Contains *.properties files as required by the service
+ │
+ ├── Plans Contains Directed Graph
+ │
+ ├── Tests Contains uat.yaml file for testing cba actions within a cba package
+ │
+ ├── Scripts Contains scripts
+ │ ├── python Python scripts
+ │ └── kotlin Kotlin scripts
+ │
+ ├── TOSCA-Metadata
+ │ └── TOSCA.meta Meta-data of overall package
+ │
+ └── Templates Contains combination of mapping and template
+
+To process a CBA for any service we need to enrich it first. This will gather all the node- type, data-type,
artifact-type, data-dictionary definitions provided in the blueprint.json.
\ No newline at end of file
.. _data_dictionary:
Data Dictionary
------------------
+---------------
A data dictionary **models the how** a specific **resource** can be **resolved**.
- The creator
- Mandatory
* - tags
- - Information related
+ - Information related
- Mandatory
* - sources
- List of resource source instance (see :ref:`resource source`)
- Mandatory
* - name
- Data dictionary name
- - Mandatory
-
+ - Mandatory
+
**Bellow are properties that all the resource source can have**
-The modeling does allow for **data translation** between external capability
+The modeling does allow for **data translation** between external capability
and CDS for both input and output key mapping.
.. list-table::
- Description
- Scope
* - input-key-mapping
- - map of resources required to perform the request/query. The left hand-side is what is used within
+ - map of resources required to perform the request/query. The left hand-side is what is used within
the query/request, the right hand side refer to a data dictionary instance.
- Optional
* - output-key-mapping
- - name of the resource to be resolved mapped to the value resolved by the request/query.
+ - name of the resource to be resolved mapped to the value resolved by the request/query.
- Optional
* - key-dependencies
- | list of data dictionary instances to be resolved prior the resolution of this specific resource.
- | during run time execution the key dependencies are recursively sorted and resolved
- in batch processing using the `acyclic graph algorithm
+ | during run time execution the key dependencies are recursively sorted and resolved
+ in batch processing using the `acyclic graph algorithm
<https://en.wikipedia.org/wiki/Directed_acyclic_graph>`_
- Optional
-
+
**Example:**
-``vf-module-model-customization-uuid`` and ``vf-module-label`` are two data dictionaries.
+``vf-module-model-customization-uuid`` and ``vf-module-label`` are two data dictionaries.
A SQL table, VF_MODULE_MODEL, exist to correlate them.
Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
:header-rows: 1
* - vf-module-label data dictionary
- * - .. code-block:: JSON
+ * - .. code-block:: json
-
- {
+ {
"name" : "vf-module-label",
"tags" : "vf-module-label",
"updated-by" : "adetalhouet",
"property" : {
- "description" : "vf-module-label",
- "type" : "string"
+ "description" : "vf-module-label",
+ "type" : "string"
},
"sources" : {
- "primary-db" : {
- "type" : "source-primary-db",
- "properties" : {
+ "primary-db" : {
+ "type" : "source-primary-db",
+ "properties" : {
"type" : "SQL",
- "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label
- from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
+ "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
"input-key-mapping" : {
- "customizationid" : "vf-module-model-customization-uuid"
+ "customizationid" : "vf-module-model-customization-uuid"
},
"output-key-mapping" : {
- "vf-module-label" : "vf_module_label"
+ "vf-module-label" : "vf_module_label"
},
"key-dependencies" : [ "vf-module-model-customization-uuid" ]
- }
- }
+ }
+ }
}
- }
\ No newline at end of file
+ }
\ No newline at end of file
.. _data_type:
Data type
--------------------------------------
+---------
Represents the **schema** of a specific type of **data**.
- * json
* list
* array
+
For complex data type, an **entry schema** is required, defining the
type of value contained within the complex type, if list or array.
**Creating Custom Data Types:**
- To create a custom data-type you can use a POST call to CDS endpoint:
+ To create a custom data-type you can use a POST call to CDS endpoint:
"<cds-ip>:<cds-port>/api/v1/model-type"
.. code-block:: python
:caption: **Payload:**
{
-
- "model-name": "<model-name>",
- "derivedFrom": "tosca.datatypes.Root",
-
- "definitionType": "data_type",
-
- "definition": {
-
+ "model-name": "<model-name>",
+ "derivedFrom": "tosca.datatypes.Root",
+ "definitionType": "data_type",
+ "definition": {
"description": "<description>",
-
"version": "<version-number: eg 1.0.0>",
-
"properties": {<add properties of your custom data type in JSON format>},
-
"derived_from": "tosca.datatypes.Root"
-
- },
-
- "description": "<description",
-
- "version": "<version>",
-
- "tags": "<model-name>,datatypes.Root.data_type",
-
- "creationDate": "<creation timestamp>",
-
- "updatedBy": "<name>"
-
+ },
+ "description": "<description",
+ "version": "<version>",
+ "tags": "<model-name>,datatypes.Root.data_type",
+ "creationDate": "<creation timestamp>",
+ "updatedBy": "<name>"
}
-Data type are useful to manipulate data during resource resolution.
+Data type are useful to manipulate data during resource resolution.
They can be used to format the JSON output as needed.
-List of existing data type:
+List of existing data type:
`<https://github.com/onap/ccsdk-cds/tree/master/components/model-catalog/definition-type/starter-type/data_type>`_
-`TOSCA specification
+`TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454187>`_
**Below is a list of existing data types**
.. tabs::
-
+
.. tab:: resource-assignment
**datatype-resource-assignment**
- Used to define entries within artifact-mapping-resource
+ Used to define entries within artifact-mapping-resource
(see tab Artifact Type -> artifact-mapping-resource)
That datatype represent a **resource** to be resolved. We also refer
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-resource-assignment.json>`_
- .. code-block:: JSON
+ .. code-block:: json
:caption: **datatype-resource-assignment**
- {
+ {
"version": "1.0.0",
"description": "This is Resource Assignment Data Type",
"properties": {
- "property": {
- "required": true,
- "type": "datatype-property"
- },
- "input-param": {
- "required": true,
- "type": "boolean"
- },
- "dictionary-name": {
- "required": false,
- "type": "string"
- },
- "dictionary-source": {
- "required": false,
- "type": "string"
- },
- "dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "updated-date": {
- "required": false,
- "type": "string"
- },
- "updated-by": {
- "required": false,
- "type": "string"
- }
+ "property": {
+ "required": true,
+ "type": "datatype-property"
+ },
+ "input-param": {
+ "required": true,
+ "type": "boolean"
+ },
+ "dictionary-name": {
+ "required": false,
+ "type": "string"
+ },
+ "dictionary-source": {
+ "required": false,
+ "type": "string"
+ },
+ "dependencies": {
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "updated-date": {
+ "required": false,
+ "type": "string"
+ },
+ "updated-by": {
+ "required": false,
+ "type": "string"
+ }
},
"derived_from": "tosca.datatypes.Root"
- }
+ }
.. tab:: property
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-property.json>`_
- .. code-block:: JSON
+ .. code-block:: json
:caption: **datatype-property**
{
- "version": "1.0.0",
- "description": "This is Resource Assignment Data Type",
- "properties": {
+ "version": "1.0.0",
+ "description": "This is Resource Assignment Data Type",
+ "properties": {
"property": {
- "required": true,
- "type": "datatype-property"
+ "required": true,
+ "type": "datatype-property"
},
"input-param": {
- "required": true,
- "type": "boolean"
+ "required": true,
+ "type": "boolean"
},
"dictionary-name": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"dictionary-source": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
},
"updated-date": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"updated-by": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
}
- },
- "derived_from": "tosca.datatypes.Root"
+ },
+ "derived_from": "tosca.datatypes.Root"
}
\ No newline at end of file
.. Copyright (C) 2020 Deutsche Telekom AG.
Dynamic Payload
--------------------------------------
+---------------
One of the most important API provided by the run time is to execute a CBA Package.
- response
* - .. code-block:: json
- {
- "commonHeader": {
- "originatorId": "",
- "requestId": "",
- "subRequestId": ""
- },
- "actionIdentifiers": {
- "blueprintName": "",
- "blueprintVersion": "",
- "actionName": "",
- "mode": ""
- },
- "payload": {
- "$actionName-request": {
- "$actionName-properties": {
- }
+ {
+ "commonHeader": {
+ "originatorId": "",
+ "requestId": "",
+ "subRequestId": ""
+ },
+ "actionIdentifiers": {
+ "blueprintName": "",
+ "blueprintVersion": "",
+ "actionName": "",
+ "mode": ""
+ },
+ "payload": {
+ "$actionName-request": {
+ "$actionName-properties": {
}
- }
+ }
}
+ }
- .. code-block:: json
-
- {
- "commonHeader": {
- "originatorId": "",
- "requestId": "",
- "subRequestId": ""
- },
- "actionIdentifiers": {
- "blueprintName": "",
- "blueprintVersion": "",
- "actionName": "",
- "mode": ""
- },
- "payload": {
- "$actionName-response": {
- }
- }
+
+ {
+ "commonHeader": {
+ "originatorId": "",
+ "requestId": "",
+ "subRequestId": ""
+ },
+ "actionIdentifiers": {
+ "blueprintName": "",
+ "blueprintVersion": "",
+ "actionName": "",
+ "mode": ""
+ },
+ "payload": {
+ "$actionName-response": {
+ }
}
+ }
The ``actionName``, under the ``actionIdentifiers`` refers to the name of a
Workflow (see :ref:`workflow`)
During the :ref:`enrichment` CDS will aggregate all the resources
defined to be resolved as input (see :ref:`node_type` -> Source -> Input), within mapping definition files
-(see :ref:`artifact_type` -> Mapping), as data-type, that will then be use as type
+(see :ref:`artifact_type` -> Mapping), as data-type, that will then be use as type
of an input called ``$actionName-properties``.
\ No newline at end of file
.. _enrichment:
Enrichment
------------
+----------
The idea is that the CBA is a self-sufficient package, hence requires
all the various types definition its using.
* gather all the node-type used and put them into a :file:`node_types.json` file
* gather all the data-type used and put them into a :file:`data_types.json` file
* gather all the artifact-type used and put them into a :file:`artifact_types.json` file
-* gather all the data dictionary definitions used from within the mapping files and put them
+* gather all the data dictionary definitions used from within the mapping files and put them
into a :file:`resources_definition_types.json` file
.. warning::
- Before uploading a CBA, it must be enriched. If your package is already enrich,
+ Before uploading a CBA, it must be enriched. If your package is already enrich,
you do not need to perform enrichment again.
-The enrichment can be run using REST API, and required the **.zip** file as input.
+The enrichment can be run using REST API, and required the **.zip** file as input.
It will return an :file:`enriched-cba.zip` file.
.. code-block:: bash
curl -X POST \
- 'http://{{ip}}:{{cds-designtime}}/api/v1/blueprint-model/enrich' \
- -H 'content-type: multipart/form-data' \
- -F file=@cba.zip
+ 'http://{{ip}}:{{cds-designtime}}/api/v1/blueprint-model/enrich' \
+ -H 'content-type: multipart/form-data' \
+ -F file=@cba.zip
The enrichment process will also, for all resources to be resolved as input and default:
Example for workflow named *resource-assignment*:
-.. code-block:: JSON
+.. code-block:: json
:caption: **dynamic input**
{
.. _expression:
Expression
--------------------------------------
+----------
TOSCA provides for a set of functions to reference elements within the template or to retrieve runtime values.
**get_input**
- The **get_input** function is used to retrieve the values of properties declared
+ The **get_input** function is used to retrieve the values of properties declared
within the inputs section of a TOSCA Service Template.
Within CDS, this is mainly Workflow inputs.
- `TOSCA specification
+ `TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
**Example:**
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L210>`_
- .. code-block:: JSON
-
+ .. code-block:: json
+
"resolution-key": {
- "get_input": "resolution-key"
+ "get_input": "resolution-key"
}
-
+
.. tab:: get_property
**get_property**
- The **get_property** function is used to retrieve property values between modelable
+ The **get_property** function is used to retrieve property values between modelable
entities defined in the same service template.
- `TOSCA specification
+ `TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
**Example:**
- TBD
+ .. code-block:: json
+
+ "get_property": ["SELF", "property-name"]
.. tab:: get_attribute
**get_attribute**
- The **get_attribute** function is used to retrieve the values of named attributes declared
+ The **get_attribute** function is used to retrieve the values of named attributes declared
by the referenced node or relationship template name.
- `TOSCA specification
+ `TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
**Example:**
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L64-L67>`_
- .. code-block:: JSON
-
+ .. code-block:: json
+
"get_attribute": [
"resource-assignment",
"assignment-params"
**get_operation_output**
- The **get_operation_output** function is used to retrieve property values between modelable
- entities defined in the same service template.
+ The **get_operation_output** function is used to retrieve the values of variables
+ exposed / exported from an interface operation.
- `TOSCA specification
+ `TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454180>`_
**Example:**
- TBD
+ .. code-block:: json
+
+ "get_operation_output": ["SELF", "interface-name", "operation-name", "output-property-name"]
.. tab:: get_artifact
**get_artifact**
- The **get_artifact** function is used to retrieve property values between modelable
+ The **get_artifact** function is used to retrieve artifact location between modelable
entities defined in the same service template.
- `TOSCA specification
+ `TOSCA specification
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454182>`_
**Example:**
- TBD
\ No newline at end of file
+ .. code-block:: json
+
+ "get_artifact" : ["SELF", "artifact-template", "location", true]
\ No newline at end of file
--- /dev/null
+.. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-2026349199
+.. This work is licensed under a Creative Commons Attribution 4.0
+.. International License. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Deutsche Telekom AG.
+
+External Systems support
+------------------------
+
+Interaction with **external systems** is made **dynamic** and **plug-able**
+removing development cycle to support new endpoint.
+In order to share the external system information, TOSCA provides a way to create macros using **dsl_definitions**:
+Link to TOSCA spec:
+`info 1 <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454160>`_,
+`info 2 <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454173>`_.
+
+Use cases:
+* Resource resolution using **REST** (see tab Node Type) or **SQL** (see tab Node Type) external systems
+* **gRPC** is supported for remote execution
+* Any REST endpoint can be dynamically injected as part of the scripting framework.
+
+Here are some examples on how to populate the system information within the package:
+
+.. list-table::
+ :widths: 100
+ :header-rows: 1
+
+ * - token-auth
+ * - .. code-block:: json
+
+ {
+ . . .
+ "dsl_definitions": {
+ "ipam-1": {
+ "type": "token-auth",
+ "url": "http://netbox-nginx.netprog:8080",
+ "token": "Token 0123456789abcdef0123456789abcdef01234567"
+ }
+ }
+
+.. list-table::
+ :widths: 100
+ :header-rows: 1
+
+ * - basic-auth
+ * - .. code-block:: json
+
+ {
+ . . .
+ "dsl_definitions": {
+ "ipam-1": {
+ "type": "basic-auth",
+ "url": "http://localhost:8080",
+ "username": "bob",
+ "password": "marley"
+ }
+ }
+ . . .
+ }
+
+.. list-table::
+ :widths: 100
+ :header-rows: 1
+
+ * - ssl-basic-auth
+ * - .. code-block:: json
+
+ {
+ . . .
+ "dsl_definitions": {
+ "ipam-1": {
+ "type" : "ssl-basic-auth",
+ "url" : "http://localhost:32778",
+ "keyStoreInstance": "JKS or PKCS12",
+ "sslTrust": "trusture",
+ "sslTrustPassword": "trustore password",
+ "sslKey": "keystore",
+ "sslKeyPassword: "keystore password"
+ }
+ }
+ . . .
+ }
+
+.. list-table::
+ :widths: 100
+ :header-rows: 1
+
+ * - grpc-executor
+ * - .. code-block:: json
+
+ {
+ . . .
+ "dsl_definitions": {
+ "remote-executor": {
+ "type": "token-auth",
+ "host": "cds-command-executor.netprog",
+ "port": "50051",
+ "token": "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=="
+ }
+ }
+ . . .
+ }
+
+.. list-table::
+ :header-rows: 1
+
+ * - maria-db
+ * - .. code-block:: json
+
+ {
+ . . .
+ "dsl_definitions": {
+ "netprog-db": {
+ "type": "maria-db",
+ "url": "jdbc:mysql://10.195.196.123:32050/netprog",
+ "username": "netprog",
+ "password": "netprog"
+ }
+ }
+ . . .
+ }
+++ /dev/null
-.. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-2026349199
-.. This work is licensed under a Creative Commons Attribution 4.0
-.. International License. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2020 Deutsche Telekom AG.
-
-External Systems support
--------------------------------------
-
-Interaction with **external systems** is made **dynamic**, removing
-development cycle to support new endpoint.
-
-In order to define the external system information, TOSCA provides
-**dsl_definitions**. Link to TOSCA spec `info 1
-<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454160>`_,
-`info 2 <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454173>`_.
-
-Use cases:
-
-* Resource resolution using **REST** (see tab Node Type) or **SQL** (see tab Node Type) external systems
-* **gRPC** is supported for remote execution
-* Any REST endpoint can be dynamically injected as part of the scripting framework.
-
-Here are some examples on how to populate the system information within the package:
-
-.. list-table::
- :widths: 100
- :header-rows: 1
-
- * - token-auth
- * - .. code-block:: JSON
-
- {
- . . .
- "dsl_definitions": {
- "ipam-1": {
- "type": "token-auth",
- "url": "http://netbox-nginx.netprog:8080",
- "token": "Token 0123456789abcdef0123456789abcdef01234567"
- }
- }
-
-.. list-table::
- :widths: 100
- :header-rows: 1
-
- * - basic-auth
- * - .. code-block:: JSON
-
- {
- . . .
- "dsl_definitions": {
- "ipam-1": {
- "type": "basic-auth",
- "url": "http://localhost:8080",
- "username": "bob",
- "password": "marley"
- }
- }
- . . .
- }
-
-.. list-table::
- :widths: 100
- :header-rows: 1
-
- * - ssl-basic-auth
- * - .. code-block:: JSON
-
- {
- . . .
- "dsl_definitions": {
- "ipam-1": {
- "type" : "ssl-basic-auth",
- "url" : "http://localhost:32778",
- "keyStoreInstance": "JKS or PKCS12",
- "sslTrust": "trusture",
- "sslTrustPassword": "trustore password",
- "sslKey": "keystore",
- "sslKeyPassword: "keystore password"
- }
- }
- . . .
- }
-
-.. list-table::
- :widths: 100
- :header-rows: 1
-
- * - grpc-executor
- * - .. code-block:: JSON
-
- {
- . . .
- "dsl_definitions": {
- "remote-executor": {
- "type": "token-auth",
- "host": "cds-command-executor.netprog",
- "port": "50051",
- "token": "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=="
- },
- }
- . . .
- }
-
-.. list-table::
- :header-rows: 1
-
- * - maria-db
- * - .. code-block:: JSON
-
- {
- . . .
- "dsl_definitions": {
- "netprog-db": {
- "type": "maria-db",
- "url": "jdbc:mysql://10.195.196.123:32050/netprog",
- "username": "netprog",
- "password": "netprog"
- }
- }
- . . .
- }
\ No newline at end of file
.. Copyright (C) 2020 Deutsche Telekom AG.
Modeling Concepts
-==================
+=================
CDS is a framework to automate the **resolution of resources** for
**instantiation** and any **config** provisioning operation, such as
:caption: Table of Contents
:maxdepth: 1
- CBA <cba>
+ cba
Tosca.Meta <tosca-meta>
dynamic-payload
enrichment
- Flexible Plug-in <flexible-plug-in>
+ external-system
expression
data-dictionary
data-type
.. _node_type:
Node type
------------
+---------
-`TOSCA definition
+`TOSCA definition
<http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454215>`_
-In CDS, we have mainly two distinct types: components and source. We have some other type as well,
+In CDS, we have mainly two distinct types: components and source. We have some other type as well,
listed in the other section.
.. tabs::
Used to represent a **functionality** along with its **contract**, such as **inputs**, **ouputs**, and **attributes**
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Component.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Component.json>`_
is the root component TOSCA node type from which other node type will derive:
-
+
.. code-block:: json
:caption: **tosca.nodes.Component**
{
- "description": "This is default Component Node",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
+ "description": "This is default Component Node",
+ "version": "1.0.0",
+ "derived_from": "tosca.nodes.Root"
}
**Bellow is a list of supported components**
.. tabs::
-
+
.. tab:: resource-resolution
**component-resource-resolution:**
Used to perform resolution of **resources**.
- Requires as many as artifact-mapping-resource (see :ref:`artifact_type` -> Mapping) AND
+ Requires as many as artifact-mapping-resource (see :ref:`artifact_type` -> Mapping) AND
artifact-template-velocity (see :ref:`artifact_type` -> Jinja) as needed.
**Output result:**
Will put the resolution result as an **attribute** in the workflow context called **assignment-params**.
- Using the :ref:`undefined <get_attribute expression>`, this attribute can be retrieve to be
+ Using the :ref:`undefined <get_attribute expression>`, this attribute can be retrieve to be
provided as workflow output (see :ref:`workflow`).
**Specify which template to resolve:**
- Currently, resolution is bounded to a template. To specify which template to use, you
+ Currently, resolution is bounded to a template. To specify which template to use, you
need to fill in the `artifact-prefix-names` field.
See :ref:`template` to understand what the artifact prefix name is.
Also, when storing the data, it must be in the context of either a `resource-id` and `resource-type`, or based on a given `resolution-key`
-
- The concept of resource-id / resource-type, or resolution-key, is to uniquely identify a specific resolution that
+
+ The concept of resource-id / resource-type, or resolution-key, is to uniquely identify a specific resolution that
has been performed for a given action. Hence the resolution-key has to be unique for a given blueprint name, blueprint version, action name.
Through the combination of the fields mentioned previously, one could retrieved what has been resolved. This is useful to manage the life-cycle of the resolved resource, the life-cycle of the template, along with sharing with external systems the outcome of a given resolution.
The resource-id / resource-type combo is more geared to uniquely identify a resource in AAI, or external system. For example, for a given AAI resource, say a PNF, you can trigger a given CDS action, and then you will be able to manage all the resolved resources bound to this PNF. Even we could have a history of what has been assigned, unassigned for this given AAI resource.
- .. warning:: Important not to confuse and AAI resource (e.g. a topology element,
- or service related element) with the resources resolved by CDS, which can be seen
+ .. warning:: Important not to confuse and AAI resource (e.g. a topology element,
+ or service related element) with the resources resolved by CDS, which can be seen
as parameters required to derived a network configuration.
**Run the resolution multiple time:**
- If you need to run the same resolution component multiple times, use the field `occurence`.
- This will add the notion of occurrence to the resolution, and if storing the results, resources
+ If you need to run the same resolution component multiple times, use the field `occurence`.
+ This will add the notion of occurrence to the resolution, and if storing the results, resources
and templates, they will be accessible for each occurrence.
- Occurrence is a number between 1 and N; when retrieving information
+ Occurrence is a number between 1 and N; when retrieving information
for a given occurrence, the first iteration starts at 1.
This feature is useful when you need to apply the same configuration accross network elements.
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-resource-resolution.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-resource-resolution.json>`_
is the definition:
.. code-block:: json
- :caption: **component-resource-resolution**
+ :caption: **component-resource-resolution**
- {
+ {
"description": "This is Resource Assignment Component API",
"version": "1.0.0",
"attributes": {
}
},
"derived_from": "tosca.nodes.Component"
- }
+ }
.. tab:: script-executor
**component-script-executor:**
- Used to **execute** a script to perform **NETCONF, RESTCONF, SSH commands**
+ Used to **execute** a script to perform **NETCONF, RESTCONF, SSH commands**
from within the runtime container of CDS.
Two type of scripts are supported:
- * Kotlin: offer a way more integrated scripting framework, along
+ * Kotlin: offer a way more integrated scripting framework, along
with a way faster processing capability. See more about Kotlin script: https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md
- * Python: uses Jython which is bound to Python 2.7, end of life Januray 2020.
+ * Python: uses Jython which is bound to Python 2.7, end of life Januray 2020.
See more about Jython: https://www.jython.org/
The `script-class-reference` field need to reference
.. _test_test_test:
.. code-block:: json
- :caption: **component-script-executor**
+ :caption: **component-script-executor**
- {
- "description": "This is Netconf Transaction Configuration Component API",
- "version": "1.0.0",
- "interfaces": {
- "ComponentScriptExecutor": {
+ {
+ "description": "This is Netconf Transaction Configuration Component API",
+ "version": "1.0.0",
+ "interfaces": {
+ "ComponentScriptExecutor": {
"operations": {
- "process": {
- "inputs": {
+ "process": {
+ "inputs": {
"script-type": {
- "description": "Script type, kotlin type is supported",
- "required": true,
- "type": "string",
- "default": "internal",
- "constraints": [
- {
+ "description": "Script type, kotlin type is supported",
+ "required": true,
+ "type": "string",
+ "default": "internal",
+ "constraints": [
+ {
"valid_values": [
- "kotlin",
- "jython",
- "internal"
+ "kotlin",
+ "jython",
+ "internal"
]
- }
- ]
+ }
+ ]
},
"script-class-reference": {
- "description": "Kotlin Script class name with full package or jython script name.",
- "required": true,
- "type": "string"
- },
+ "description": "Kotlin Script class name with full package or jython script name.",
+ "required": true,
+ "type": "string"
+ },
"dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
+ "description": "Dynamic Json Content or DSL Json reference.",
+ "required": false,
+ "type": "json"
}
- },
- "outputs": {
+ },
+ "outputs": {
"response-data": {
- "description": "Execution Response Data in JSON format.",
- "required": false,
- "type": "string"
+ "description": "Execution Response Data in JSON format.",
+ "required": false,
+ "type": "string"
},
"status": {
- "description": "Status of the Component Execution ( success or failure )",
- "required": true,
- "type": "string"
+ "description": "Status of the Component Execution ( success or failure )",
+ "required": true,
+ "type": "string"
}
- }
- }
+ }
+ }
}
- }
- },
- "derived_from": "tosca.nodes.Component"
- }
+ }
+ },
+ "derived_from": "tosca.nodes.Component"
+ }
.. tab:: remote-script-executor
execute-command-logs: will contain the execution logs of the script, that were printed into stdout
- Using the get_attribute expression (see :ref:`expression` -> get_attribute),
+ Using the get_attribute expression (see :ref:`expression` -> get_attribute),
this attribute can be retrieve to be provided as workflow output (see :ref:`workflow`).
**Params:**
- The `command` field need to reference the path from the Scripts folder of the
+ The `command` field need to reference the path from the Scripts folder of the
scripts to execute, e.g. Scripts/python/Bob.py
- The `packages` field allow to provide a list of **PIP package** to install in the target environment,
+ The `packages` field allow to provide a list of **PIP package** to install in the target environment,
or a requirements.txt file. Also, it supports **Ansible role**.
- If **requirements.txt** is specified, then it should be **provided** as
+ If **requirements.txt** is specified, then it should be **provided** as
part of the **Environment** folder of the CBA.
.. code-block:: json
:caption: **Example**
"packages": [
- {
- "type": "pip",
- "package": [
+ {
+ "type": "pip",
+ "package": [
"requirements.txt"
- ]
- },
- {
- "type": "ansible_galaxy",
- "package": [
+ ]
+ },
+ {
+ "type": "ansible_galaxy",
+ "package": [
"juniper.junos"
- ]
- }
+ ]
+ }
]
- The `argument-properties` allows to specified input argument to the script to execute. They should be
- expressed in a DSL, and they will be ordered as specified.
+ The `argument-properties` allows to specified input argument to the script to execute. They should be
+ expressed in a DSL, and they will be ordered as specified.
.. code-block:: json
- :caption: **Example**
+ :caption: **Example**
"ansible-argument-properties": {
- "arg0": "-i",
- "arg1": "Scripts/ansible/inventory.yaml",
- "arg2": "--extra-vars",
- "arg3": {
- "get_attribute": [
+ "arg0": "-i",
+ "arg1": "Scripts/ansible/inventory.yaml",
+ "arg2": "--extra-vars",
+ "arg3": {
+ "get_attribute": [
"resolve-ansible-vars",
"",
"assignment-params",
"ansible-vars"
- ]
- }
- }
+ ]
+ }
}
- The `dynamic-properties` can be anything that needs to be passed to the
- script that couldn't be passed as an argument, such as JSON object, etc... If used, they will be passed
+ The `dynamic-properties` can be anything that needs to be passed to the
+ script that couldn't be passed as an argument, such as JSON object, etc... If used, they will be passed
in as the last argument of the Python script.
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json>`_
is the definition
.. code-block:: json
- :caption: **component-remote-script-executor**
+ :caption: **component-remote-script-executor**
{
- "description": "This is Remote Python Execution Component.",
- "version": "1.0.0",
- "attributes": {
+ "description": "This is Remote Python Execution Component.",
+ "version": "1.0.0",
+ "attributes": {
"prepare-environment-logs": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"execute-command-logs": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
+ "required": false,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
},
"response-data": {
- "required": false,
- "type": "json"
+ "required": false,
+ "type": "json"
}
- },
- "capabilities": {
+ },
+ "capabilities": {
"component-node": {
- "type": "tosca.capabilities.Node"
+ "type": "tosca.capabilities.Node"
}
- },
- "interfaces": {
+ },
+ "interfaces": {
"ComponentRemotePythonExecutor": {
- "operations": {
- "process": {
+ "operations": {
+ "process": {
"inputs": {
- "endpoint-selector": {
- "description": "Remote Container or Server selector name.",
- "required": false,
- "type": "string",
- "default": "remote-python"
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- },
- "argument-properties": {
- "description": "Argument Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- },
- "command": {
- "description": "Command to execute.",
- "required": true,
- "type": "string"
- },
- "packages": {
- "description": "Packages to install based on type.",
- "required": false,
- "type" : "list",
- "entry_schema" : {
+ "endpoint-selector": {
+ "description": "Remote Container or Server selector name.",
+ "required": false,
+ "type": "string",
+ "default": "remote-python"
+ },
+ "dynamic-properties": {
+ "description": "Dynamic Json Content or DSL Json reference.",
+ "required": false,
+ "type": "json"
+ },
+ "argument-properties": {
+ "description": "Argument Json Content or DSL Json reference.",
+ "required": false,
+ "type": "json"
+ },
+ "command": {
+ "description": "Command to execute.",
+ "required": true,
+ "type": "string"
+ },
+ "packages": {
+ "description": "Packages to install based on type.",
+ "required": false,
+ "type" : "list",
+ "entry_schema" : {
"type" : "dt-system-packages"
- }
- }
+ }
+ }
}
- }
- }
+ }
+ }
}
- },
- "derived_from": "tosca.nodes.Component"
+ },
+ "derived_from": "tosca.nodes.Component"
}
.. tab:: remote-ansible-executor
.. code-block:: json
:caption: **component-remote-script-executor**
- {
- "description": "This is Remote Ansible Playbook (AWX) Execution Component.",
- "version": "1.0.0",
- "attributes": {
- "ansible-command-status": {
+ {
+ "description": "This is Remote Ansible Playbook (AWX) Execution Component.",
+ "version": "1.0.0",
+ "attributes": {
+ "ansible-command-status": {
"required": true,
"type": "string"
- },
- "ansible-command-logs": {
+ },
+ "ansible-command-logs": {
"required": true,
"type": "string"
- }
- },
- "capabilities": {
- "component-node": {
+ }
+ },
+ "capabilities": {
+ "component-node": {
"type": "tosca.capabilities.Node"
- }
- },
- "interfaces": {
- "ComponentRemoteAnsibleExecutor": {
+ }
+ },
+ "interfaces": {
+ "ComponentRemoteAnsibleExecutor": {
"operations": {
- "process": {
- "inputs": {
+ "process": {
+ "inputs": {
"job-template-name": {
- "description": "Primary key or name of the job template to launch new job.",
- "required": true,
- "type": "string"
+ "description": "Primary key or name of the job template to launch new job.",
+ "required": true,
+ "type": "string"
},
"limit": {
- "description": "Specify host limit for job template to run.",
- "required": false,
- "type": "string"
+ "description": "Specify host limit for job template to run.",
+ "required": false,
+ "type": "string"
},
"inventory": {
- "description": "Specify inventory for job template to run.",
- "required": false,
- "type": "string"
+ "description": "Specify inventory for job template to run.",
+ "required": false,
+ "type": "string"
},
- "extra-vars" : {
- "required" : false,
- "type" : "json",
- "description": "json formatted text that contains extra variables to pass on."
+ "extra-vars": {
+ "required": false,
+ "type": "json",
+ "description": "json formatted text that contains extra variables to pass on."
},
"tags": {
- "description": "Specify tagged actions in the playbook to run.",
- "required": false,
- "type": "string"
+ "description": "Specify tagged actions in the playbook to run.",
+ "required": false,
+ "type": "string"
},
"skip-tags": {
- "description": "Specify tagged actions in the playbook to omit.",
- "required": false,
- "type": "string"
+ "description": "Specify tagged actions in the playbook to omit.",
+ "required": false,
+ "type": "string"
},
"endpoint-selector": {
- "description": "Remote AWX Server selector name.",
- "required": true,
- "type": "string"
+ "description": "Remote AWX Server selector name.",
+ "required": true,
+ "type": "string"
}
- }
- }
+ }
+ }
}
- }
- },
- "derived_from": "tosca.nodes.Component"
- }
+ }
+ },
+ "derived_from": "tosca.nodes.Component"
+ }
.. tab:: Source
Defines the **contract** to resolve a resource.
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.ResourceSource.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.ResourceSource.json>`_
is the root component TOSCA node type from which other node type will derive:
.. code-block::
:caption: **tosca.nodes.Component**
{
- "description": "TOSCA base type for Resource Sources",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
+ "description": "TOSCA base type for Resource Sources",
+ "version": "1.0.0",
+ "derived_from": "tosca.nodes.Root"
}
**Bellow is a list of supported sources**
- .. tabs::
+ .. tabs::
+
.. tab:: input
**Input:**
Expects the **value to be provided as input** to the request.
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-input.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-input.json>`_
is the Definition
- .. code-block::
+ .. code-block::
:caption: **source-input**
{
- "description": "This is Input Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
+ "description": "This is Input Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {},
+ "derived_from": "tosca.nodes.ResourceSource"
}
.. tab:: default
Expects the **value to be defaulted** in the model itself.
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-default.json>`_
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-default.json>`_
is the Definition
.. code-block:: json
:caption: **source-default**
{
- "description": "This is Default Resource Source Node Type",
- "version": "1.0.0",
- "properties": {},
- "derived_from": "tosca.nodes.ResourceSource"
+ "description": "This is Default Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {},
+ "derived_from": "tosca.nodes.ResourceSource"
}
.. tab:: rest
Expects the **URI along with the VERB and the payload**, if needed.
- CDS is currently deployed along the side of SDNC, hence the **default** rest
+ CDS is currently deployed along the side of SDNC, hence the **default** rest
**connection** provided by the framework is to **SDNC MDSAL**.
.. list-table::
* - expression-type
- Path expression type - default value is JSON_PATH
- Optional
-
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-rest.json>`_
+
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-rest.json>`_
is the definition:
.. code-block:: json
:caption: **source-rest**
- {
- "description": "This is Rest Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "JSON",
- "constraints": [
- {
- "valid_values": [
- "JSON"
- ]
- }
- ]
- },
- "verb": {
- "required": false,
- "type": "string",
- "default": "GET",
- "constraints": [
- {
- "valid_values": [
- "GET", "POST", "DELETE", "PUT"
- ]
- }
- ]
- },
- "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",
- "default": "JSON_PATH",
- "constraints": [
- {
- "valid_values": [
- "JSON_PATH",
- "JSON_POINTER"
- ]
- }
- ]
- },
- "input-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
- },
- "output-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
+ {
+ "description": "This is Rest Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
+ "required": false,
+ "type": "string",
+ "default": "JSON",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON"
+ ]
+ }
+ ]
+ },
+ "verb": {
+ "required": false,
+ "type": "string",
+ "default": "GET",
+ "constraints": [
+ {
+ "valid_values": [
+ "GET",
+ "POST",
+ "DELETE",
+ "PUT"
+ ]
+ }
+ ]
+ },
+ "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",
+ "default": "JSON_PATH",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON_PATH",
+ "JSON_POINTER"
+ ]
+ }
+ ]
+ },
+ "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"
+ }
+ }
},
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
- }
-
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
.. tab:: sql
**SQL**
- Expects the **SQL query** to be modeled; that SQL query can be parameterized,
- and the parameters be other resources resolved through other means.
+ Expects the **SQL query** to be modeled; that SQL query can be parameterized,
+ and the parameters be other resources resolved through other means.
If that's the case, this data dictionary definition will have to define ``key-dependencies`` along with ``input-key-mapping``.
- CDS is currently deployed along the side of SDNC, hence the **primary** database
+ CDS is currently deployed along the side of SDNC, hence the **primary** database
**connection** provided by the framework is to **SDNC database**.
.. list-table::
- Statement to execute
- Mandatory
-
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-processor-db.json>`_
+
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-processor-db.json>`_
is the definition:
.. code-block:: json
:caption: **source-db**
- {
- "description": "This is Database Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
+ {
+ "description": "This is Database Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
"required": true,
"type": "string",
"constraints": [
- {
- "valid_values": [
+ {
+ "valid_values": [
"SQL"
- ]
- }
+ ]
+ }
]
- },
- "endpoint-selector": {
+ },
+ "endpoint-selector": {
"required": false,
"type": "string"
- },
- "query": {
+ },
+ "query": {
"required": true,
"type": "string"
- },
- "input-key-mapping": {
+ },
+ "input-key-mapping": {
"required": false,
"type": "map",
"entry_schema": {
- "type": "string"
+ "type": "string"
}
- },
- "output-key-mapping": {
+ },
+ "output-key-mapping": {
"required": false,
"type": "map",
"entry_schema": {
- "type": "string"
+ "type": "string"
}
- },
- "key-dependencies": {
+ },
+ "key-dependencies": {
"required": true,
"type": "list",
"entry_schema": {
- "type": "string"
+ "type": "string"
}
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
- }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
.. tab:: capability
* - Property
- Description
- Scope
- * - script-type
+ * - script-type
- The type of the script - default value is Koltin
- Optional
* - script-class-reference
- The name of the class to use to create an instance of the script
- Mandatory
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-capability.json>`_
- is the definition:
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-capability.json>`_
+ is the definition:
.. code-block:: json
- :caption: **source-capability**
+ :caption: **source-capability**
- {
- "description": "This is Component Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "script-type": {
+ {
+ "description": "This is Component Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "script-type": {
"required": true,
"type": "string",
"default": "kotlin",
"constraints": [
- {
- "valid_values": [
+ {
+ "valid_values": [
"internal",
"kotlin",
"jython"
- ]
- }
+ ]
+ }
]
- },
- "script-class-reference": {
+ },
+ "script-class-reference": {
"description": "Capability reference name for internal and kotlin, for jython script file path",
"required": true,
"type": "string"
- },
- "key-dependencies": {
+ },
+ "key-dependencies": {
"description": "Resource Resolution dependency dictionary names.",
"required": true,
"type": "list",
"entry_schema": {
- "type": "string"
+ "type": "string"
}
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
- }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
.. tab:: Other
* - Property
- Description
- Scope
- * - dependency-node-templates
+ * - dependency-node-templates
- The node template the workflow depends on
- Required
- `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/dg-generic.json>`_
- is the definition:
+ `Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/dg-generic.json>`_
+ is the definition:
.. code-block:: json
:caption: **dg-generic**
- {
- "description": "This is Generic Directed Graph Type",
- "version": "1.0.0",
- "properties": {
- "content": {
- "required": true,
- "type": "string"
+ {
+ "description": "This is Generic Directed Graph Type",
+ "version": "1.0.0",
+ "properties": {
+ "content": {
+ "required": true,
+ "type": "string"
+ },
+ "dependency-node-templates": {
+ "required": true,
+ "description": "Dependent Step Components NodeTemplate name.",
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
},
- "dependency-node-templates": {
- "required": true,
- "description": "Dependent Step Components NodeTemplate name.",
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.DG"
- }
+ "derived_from": "tosca.nodes.DG"
+ }
- A node_template of this type always provide one artifact, of type artifact-directed-graph,
+ A node_template of this type always provide one artifact, of type artifact-directed-graph,
which will be located under the Plans/ folder within the CBA.
.. code-block:: json
:caption: **node_template example**
- "config-deploy-process" : {
- "type" : "dg-generic",
- "properties" : {
- "content" : {
- "get_artifact" : [ "SELF", "dg-config-deploy-process" ]
- },
- "dependency-node-templates" : [ "nf-account-collection", "execute" ]
- },
- "artifacts" : {
- "dg-config-deploy-process" : {
- "type" : "artifact-directed-graph",
- "file" : "Plans/CONFIG_ConfigDeploy.xml"
+ {
+ "config-deploy-process": {
+ "type": "dg-generic",
+ "properties": {
+ "content": {
+ "get_artifact": [
+ "SELF",
+ "dg-config-deploy-process"
+ ]
+ },
+ "dependency-node-templates": [
+ "nf-account-collection",
+ "execute"
+ ]
+ },
+ "artifacts": {
+ "dg-config-deploy-process": {
+ "type": "artifact-directed-graph",
+ "file": "Plans/CONFIG_ConfigDeploy.xml"
+ }
+ }
}
- }
- }
+ }
In the DG bellow, the execute node refers to the node_template.
xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='CONFIG' version='1.0.0'>
<method rpc='ConfigDeploy' mode='sync'>
<block atomic="true">
- <execute plugin="nf-account-collection" method="process">
- <outcome value='failure'>
- <return status="failure">
- </return>
- </outcome>
- <outcome value='success'>
- <execute plugin="execute" method="process">
- <outcome value='failure'>
- <return status="failure">
- </return>
- </outcome>
- <outcome value='success'>
- <return status='success'>
- </return>
- </outcome>
- </execute>
- </outcome>
- </execute>
+ <execute plugin="nf-account-collection" method="process">
+ <outcome value='failure'>
+ <return status="failure">
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <execute plugin="execute" method="process">
+ <outcome value='failure'>
+ <return status="failure">
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
</block>
</method>
</service-logic>
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
}
-
+
**vnf-netconf-device**
Represents the VNF information to **establish** a **NETCONF communication**.
},
"derived_from": "tosca.nodes.Vnf"
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
.. Copyright (C) 2020 Deutsche Telekom AG.
Scripts
--------------
+-------
Library
+++++++++++++++++
NetconfClient
+++++++++++++++++
-In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available.
+In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available.
This NetconfClient can be used when using the component-netconf-executor.
The client can be find here: https://github.com/onap/ccsdk-cds/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py
ResolutionHelper
+++++++++++++++++
-When executing a component executor script, designer might want to perform
+When executing a component executor script, designer might want to perform
resource resolution along with template meshing directly from the script itself.
-The helper can be find here:
+The helper can be find here:
https://github.com/onap/ccsdk-cds/blob/master/components/scripts/python/ccsdk_netconf/common.py
\ No newline at end of file
.. Copyright (C) 2020 Deutsche Telekom AG.
Southbound Interfaces
--------------------------
+---------------------
-CDS comes with native python 3.6 support and Ansible AWX (Ansible Tower):
-idea is Network Ops are familiar with Python and/or Ansible, and our goal is not to dictate the SBI to use for
-their operations. Ansible and Python provide already many, and well adopted,
+CDS comes with native python 3.6 support and Ansible AWX (Ansible Tower):
+idea is Network Ops are familiar with Python and/or Ansible, and our goal is not to dictate the SBI to use for
+their operations. Ansible and Python provide already many, and well adopted,
SBI libraries, hence they could be utilized as needed.
CDS also provide native support for the following libraries:
* SSH
* gRPC (hence gNMI / gNOI should be supported)
-CDS also has extensible REST support, meaning any RESTful interface used for network interaction can be used,
+CDS also has extensible REST support, meaning any RESTful interface used for network interaction can be used,
such as external VNFM or EMS.
\ No newline at end of file
.. _template:
Template
------------
+--------
-A template is an **artifact**, and uses artifact-mapping-resource (see :ref:`artifact_type` -> Mapping)
+A template is an **artifact**, and uses artifact-mapping-resource (see :ref:`artifact_type` -> Mapping)
and artifact-template-velocity (see :ref:`artifact_type` -> Velocity).
A template is **parameterized** and each parameter must be defined in a corresponding **mapping file**.
-In order to know which mapping correlates to which template, the file name must start with an ``artifact-prefix``,
+In order to know which mapping correlates to which template, the file name must start with an ``artifact-prefix``,
serving as identifier to the overall template + mapping.
The **requirement** is as follows:
.. Copyright (C) 2020 Deutsche Telekom AG.
Tests
---------
+-----
-The **tests** folder contains the **uat.yaml** file for execution the cba actions for sunny day and rainy day
-scenario using mock data. The process to generate the uat file is documented TBD. The file can be dragged
-and drop to the Tests folder after the test for all actions are executed.
+The **tests** folder contains the **uat.yaml** file for execution the cba actions for sunny day and rainy day
+scenario using mock data. The process to generate the uat file is documented TBD. The file can be dragged
+and drop to the Tests folder after the test for all actions are executed.
-NOTE: You need to activate the "uat" Spring Boot profile in order to enable the spy/verify endpoints.
-They are disabled by default because the mocks created at runtime can potentially cause collateral problems in production.
-You can either pass an option to JVM (``-Dspring.profiles.active=uat``) or set and export an
+NOTE: You need to activate the "uat" Spring Boot profile in order to enable the spy/verify endpoints.
+They are disabled by default because the mocks created at runtime can potentially cause collateral problems in production.
+You can either pass an option to JVM (``-Dspring.profiles.active=uat``) or set and export an
environment variable (``export spring_profiles_active=uat``).
A quick outline of the UAT generation process follows:
1. Create a minimum :file:`uat.yaml` containing only the NB requests to be sent to the BlueprintsProcessor (BPP) service;
2. Submit the blueprint CBA and this draft :file:`uat.yaml` to BPP in a single HTTP POST call:
- ``curl -u ccsdkapps:ccsdkapps -F cba=@<path to your CBA file> -F uat=@<path to the
+ ``curl -u ccsdkapps:ccsdkapps -F cba=@<path to your CBA file> -F uat=@<path to the
draft uat.yaml> http://localhost:8080/api/v1/uat/spy``
3. If your environment is properly setup, at the end this service will generate the complete :file:`uat.yaml`;
4. Revise the generate file, eventually removing superfluous message fields;
5. Include this file in your CBA under :file:`Tests/uat.yaml`;
-6. Submit the candidate CBA + UAT to be validated by BPP, that now will create runtime mocks to simulate
+6. Submit the candidate CBA + UAT to be validated by BPP, that now will create runtime mocks to simulate
all SB collaborators, by running:
``$ curl -u ccsdkapps:ccsdkapps -F cba=@<path to your CBA file> http://localhost:8080/api/v1/uat/verify``
-7. Once validated, your CBA enhanced with its corresponding UAT is eligible
+7. Once validated, your CBA enhanced with its corresponding UAT is eligible
to be integrated into the CDS project, under the folder :file:`components/model-catalog/blueprint-model/uat-blueprints`.
-Reference link for sample generated uat.yaml file for pnf plug & play use case:
+Reference link for sample generated uat.yaml file for pnf plug & play use case:
`uat.yaml file <https://gerrit.onap.org/r/gitweb?p=ccsdk/cds.git;a=tree;f=components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests;h=230d506720c4a1066784c1fe9e0ba0206bbb13cf;hb=refs/heads/master>`_.
-As UAT is part of unit testing, it runs in jenkins job
-`ccsdk-cds-master-verify-java <https://jenkins.onap.org/job/ccsdk-cds-master-verify-java/>`_
+As UAT is part of unit testing, it runs in jenkins job
+`ccsdk-cds-master-verify-java <https://jenkins.onap.org/job/ccsdk-cds-master-verify-java/>`_
whenever a new commit/patch pushed on gerrit in ccsdk/cds repo.
\ No newline at end of file
.. Copyright (C) 2020 Deutsche Telekom AG.
Tosca Meta
-------------
+----------
Tosca meta file captures the model entities that compose the cba package name, version, type and searchable tags.
- Required
- String
- | The attribute that holds the blueprint version
- |
- | X.Y.Z
- |
+ | **X.Y.Z**
| X=Major version
| Y=Minor Version
| Z=Revision Version
- |
- | X=Ex. 1.0.0
+ | X=Ex. 1.0.0
* - Template-Type
- Required
- String
- | The attribute that holds the blueprint package types.
| Valid Options:
* "DEFAULT" – .JSON file consistent of tosca based cba package that describes the package intent.
- * "KOTLIN_DSL" – .KT file consistent of tosca based cba package that describes the package intent
- composed using Domain Specific Language (DSL).
- * "GENERIC_SCRIPT" – Script file consistent of NONE tosca based cba package that describes the package intent
+ * "KOTLIN_DSL" – .KT file consistent of tosca based cba package that describes the package intent
+ composed using Domain Specific Language (DSL).
+ * "GENERIC_SCRIPT" – Script file consistent of NONE tosca based cba package that describes the package intent
using DSL Language.
| If not specified in the tosca.meta file the default is "DEFAULT"
* - Template-Tags
**Default Template Type**
-https://gerrit.onap.org/r/gitweb?p=ccsdk/cds.git;a=blob;f=components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta;hb=refs/heads/master
+https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta
**KOTLIN_DSL Template Type**
-https://gerrit.onap.org/r/gitweb?p=ccsdk/cds.git;a=blob;f=components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta;hb=refs/heads/master
+https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta
**GENERIC_SCRIPT Template Type**
-https://gerrit.onap.org/r/gitweb?p=ccsdk/cds.git;a=tree;f=ms/py-executor/test/resources/sample-cba/1.0.0;hb=refs/heads/master
\ No newline at end of file
+https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta
\ No newline at end of file
.. _workflow:
Workflow
----------
+--------
.. note::
**Workflow Scope within CDS Framework**
- The workflow is within the scope of the micro provisioning and configuration
- management in **controller domain** and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project.
+ The workflow is within the scope of the micro provisioning and configuration
+ management in **controller domain** and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project.
-A workflow defines an overall action to be taken on the service, hence is an
+A workflow defines an overall action to be taken on the service, hence is an
entry-point for the run-time execution of the :ref:`CBA Package <cba>`.
-A workflow also defines **inputs** and **outputs** that will defined the **payload contract**
+A workflow also defines **inputs** and **outputs** that will defined the **payload contract**
of the **request** and **response** (see :ref:`Dynamic API`)
A workflow can be **composed** of one or multiple **sub-actions** to execute.
The workflow is directly backed by a component (see :ref:`node_type` -> Component).
-In the example bellow, the target of the workflow's steps resource-assignment is ``resource-assignment``
+In the example bellow, the target of the workflow's steps resource-assignment is ``resource-assignment``
which actually is the name of the ``node_template`` defined after, of type ``component-resource-resolution``.
-`Link to example
+`Link to example
<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L40-L71>`_
:caption: **Example**
. . .
- "topology_template": {
- "workflows": {
- "resource-assignment": {
- "steps": {
- "resource-assignment": {
- "description": "Resource Assign Workflow",
- "target": "resource-assignment"
- ]
+ "topology_template": {
+ "workflows": {
+ "resource-assignment": {
+ "steps": {
+ "resource-assignment": {
+ "description": "Resource Assign Workflow",
+ "target": "resource-assignment"
+ }
}
- },
- "inputs": {
+ },
+ "inputs": {
"resource-assignment-properties": {
- "description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
- "required": true,
- "type": "dt-resource-assignment-properties"
+ "description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
+ "required": true,
+ "type": "dt-resource-assignment-properties"
}
- },
- "outputs": {
+ },
+ "outputs": {
"meshed-template": {
- "type": "json",
- "value": {
- "get_attribute": [
+ "type": "json",
+ "value": {
+ "get_attribute": [
"resource-assignment",
"assignment-params"
- ]
- }
+ ]
+ }
}
- }
- },
- "node_templates": {
- "resource-assignment": {
- "type": "component-resource-resolution",
- "interfaces": {
- "ResourceResolutionComponent": {
- "operations": {
- "process": {
- "inputs": {
- "artifact-prefix-names": [
- "vf-module-1"
- ]
+ }
+ },
+ "node_templates": {
+ "resource-assignment": {
+ "type": "component-resource-resolution",
+ "interfaces": {
+ "ResourceResolutionComponent": {
+ "operations": {
+ "process": {
+ "inputs": {
+ "artifact-prefix-names": [
+ "vf-module-1"
+ ]
+ }
}
- }
- }
- }
- },
- "artifacts": {
- "vf-module-1-template": {
- "type": "artifact-template-velocity",
- "file": "Templates/vf-module-1-template.vtl"
+ }
+ }
},
- "vf-module-1-mapping": {
- "type": "artifact-mapping-resource",
- "file": "Templates/vf-module-1-mapping.json"
+ "artifacts": {
+ "vf-module-1-template": {
+ "type": "artifact-template-velocity",
+ "file": "Templates/vf-module-1-template.vtl"
+ },
+ "vf-module-1-mapping": {
+ "type": "artifact-mapping-resource",
+ "file": "Templates/vf-module-1-mapping.json"
+ }
}
- }
- }
+ }
+ }
}
- . . .
+ . . .
.. _workflow_multiple_actions:
Multiple sub-actions
**********************
-The workflow is backed by a Directed Graph engine, dg-generic (see :ref:`node_type` -> DG,
+The workflow is backed by a Directed Graph engine, dg-generic (see :ref:`node_type` -> DG,
and is an **imperative** workflow.
-A DG used as workflow for CDS is composed of multiple execute nodes; each individual
+A DG used as workflow for CDS is composed of multiple execute nodes; each individual
execute node refers to an modelled Component (see :ref:`node_type` -> Component) instance.
-In the example above, you can see the target of the workflow's steps execute-script is
+In the example above, you can see the target of the workflow's steps execute-script is
``execute-remote-ansible-process``, which is a node_template of type ``dg_generic``
-`Link of example
-<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json#L184-L204>`_
+`Link of example
+<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json#L184-L204>`_
.. code-block:: json
:caption: **workflow plan example**
- . . .
- "topology_template": {
+ . . .
+ "topology_template": {
"workflows": {
- "execute-remote-ansible": {
- "steps": {
+ "execute-remote-ansible": {
+ "steps": {
"execute-script": {
- "description": "Execute Remote Ansible Script",
- "target": "execute-remote-ansible-process"
- ]
+ "description": "Execute Remote Ansible Script",
+ "target": "execute-remote-ansible-process"
}
- },
- "inputs": {
- "ip": {
- "required": false,
- "type": "string"
- },
- "username": {
- "required": false,
- "type": "string"
- },
- "password": {
- "required": false,
- "type": "string"
- },
- "execute-remote-ansible-properties": {
- "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).",
- "required": true,
- "type": "dt-execute-remote-ansible-properties"
+ }
+ },
+ "inputs": {
+ "ip": {
+ "required": false,
+ "type": "string"
+ },
+ "username": {
+ "required": false,
+ "type": "string"
+ },
+ "password": {
+ "required": false,
+ "type": "string"
+ },
+ "execute-remote-ansible-properties": {
+ "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).",
+ "required": true,
+ "type": "dt-execute-remote-ansible-properties"
+ }
+ },
+ "outputs": {
+ "ansible-variable-resolution": {
+ "type": "json",
+ "value": {
+ "get_attribute": [
+ "resolve-ansible-vars",
+ "assignment-params"
+ ]
}
- },
- "outputs": {
- "ansible-variable-resolution": {
- "type": "json",
- "value": {
- "get_attribute": [
- "resolve-ansible-vars",
- "assignment-params"
- ]
- }
- },
- "prepare-environment-logs": {
- "type": "string",
- "value": {
- "get_attribute": [
- "execute-remote-ansible",
- "prepare-environment-logs"
- ]
- }
- },
- "execute-command-logs": {
- "type": "string",
- "value": {
- "get_attribute": [
- "execute-remote-ansible",
- "execute-command-logs"
- ]
- }
+ },
+ "prepare-environment-logs": {
+ "type": "string",
+ "value": {
+ "get_attribute": [
+ "execute-remote-ansible",
+ "prepare-environment-logs"
+ ]
+ }
+ },
+ "execute-command-logs": {
+ "type": "string",
+ "value": {
+ "get_attribute": [
+ "execute-remote-ansible",
+ "execute-command-logs"
+ ]
}
- }
- }
- },
- "node_templates": {
- "execute-remote-ansible-process": {
- "type": "dg-generic",
- "properties": {
- "content": {
- "get_artifact": [
- "SELF",
- "dg-execute-remote-ansible-process"
- ]
+ }
+ },
+ "node_templates": {
+ "execute-remote-ansible-process": {
+ "type": "dg-generic",
+ "properties": {
+ "content": {
+ "get_artifact": [
+ "SELF",
+ "dg-execute-remote-ansible-process"
+ ]
+ },
+ "dependency-node-templates": [
+ "resolve-ansible-vars",
+ "execute-remote-ansible"
+ ]
},
- "dependency-node-templates": [
- "resolve-ansible-vars",
- "execute-remote-ansible"
- ]
- },
- "artifacts": {
- "dg-execute-remote-ansible-process": {
- "type": "artifact-directed-graph",
- "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml"
+ "artifacts": {
+ "dg-execute-remote-ansible-process": {
+ "type": "artifact-directed-graph",
+ "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml"
+ }
}
- }
- }
+ }
+ }
+ }
+ }
Properties of a workflow
**************************
- Defines the name of the action that can be triggered by external system
* - inputs
- | They are two types of inputs, the dynamic ones, and the static one.
- |
+ |
.. tabs::
-
+
.. tab:: static
-
+
Specified at workflow level
* can be inputs for the Component(s), see the inputs section of the component of interest.
These will end up under ``${actionName}-request`` section of the payload (see Dynamic API)
.. tab:: dynamic
-
- Represent the resources defined as input (see :ref:`node_type` -> Source -> Input)
+
+ Represent the resources defined as input (see :ref:`node_type` -> Source -> Input)
within mapping definition files (see :ref:`artifact_type` -> Mapping).
The **enrichment process** will (see :ref:`enrichment`)
- value resolvable using :ref:`expression` -> get_attribute
* - steps
- | Defines the actual step to execute as part of the workflow
- |
+ |
.. list-table::
:widths: 25 25 50
- :header-rows: 1
-
+ :header-rows: 1
+
* - step-name
- description
- target
* - name of the step
- step description
- - | a node_template implementing on of the supported Node Type (see :ref:`node_type` -> DG),
+ - | a node_template implementing on of the supported Node Type (see :ref:`node_type` -> DG),
either a Component or a DG
| (see :ref:`workflow_single_action` or :ref:`workflow_multiple_actions`)
.. code-block:: json
:caption: **workflow example**
- {
- "workflow": {
- "resource-assignment": { <- workflow-name
+ {
+ "workflow": {
+ "resource-assignment": { <- workflow-name
"inputs": {
- "vnf-id": { <- static inputs
- "required": true,
- "type": "string"
- },
- "resource-assignment-properties": { <- dynamic inputs
- "required": true,
- "type": "dt-resource-assignment-properties"
- }
+ "vnf-id": { <- static inputs
+ "required": true,
+ "type": "string"
+ },
+ "resource-assignment-properties": { <- dynamic inputs
+ "required": true,
+ "type": "dt-resource-assignment-properties"
+ }
},
"steps": {
- "call-resource-assignment": { <- step-name
- "description": "Resource Assignment Workflow",
- "target": "resource-assignment-process" <- node_template targeted by the step
- }
+ "call-resource-assignment": { <- step-name
+ "description": "Resource Assignment Workflow",
+ "target": "resource-assignment-process" <- node_template targeted by the step
+ }
},
"outputs": {
- "template-properties": { <- output
- "type": "json", <- complex type
- "value": {
+ "template-properties": { <- output
+ "type": "json", <- complex type
+ "value": {
"get_attribute": [ <- uses expression to retrieve attribute from context
- "resource-assignment",
- "assignment-params"
+ "resource-assignment",
+ "assignment-params"
]
- }
- }
+ }
+ }
}
- }
+ }
+ }
}
- }
`TOSCA definition <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454203>`_
tox
-Sphinx
+Sphinx>=2,<4
doc8
docutils
setuptools
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2019 IBM.
-Resource Definition
--------------------
+Resource Definition
+===================
.. toctree::
- :maxdepth: 1
+ :maxdepth: 2
Introduction:
-=============
+-------------
A Resource definition models the how a specific resource can be resolved.
A resource is a variable/parameter in the context of the service. It can be anything, but it should not be confused with SDC or Openstack resources.
|image0|
-
-
Below are properties that all the resource source have will have
The modeling does allow for data translation between external capability and CDS for both input and output key mapping.
Example:
-========
+--------
vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.
Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
-.. toctree::
- :maxdepth: 1
-
- resourcedefinitioncodesnip
+.. code-block:: json
+ :linenos:
+
+ {
+ "description": "This is Component Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "script-type": {
+ "required": true,
+ "type": "string",
+ "default": "kotlin",
+ "constraints": [
+ {
+ "valid_values": [
+ "kotlin",
+ "jython"
+ ]
+ }
+ ]
+ },
+ "script-class-reference": {
+ "description": "Capability reference name for internal and kotlin, for jython script file path",
+ "required": true,
+ "type": "string"
+ },
+ "instance-dependencies": {
+ "required": false,
+ "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "key-dependencies": {
+ "description": "Resource Resolution dependency dictionary names.",
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
Resource source:
-================
+----------------
Defines the contract to resolve a resource.
Also please click below for resource source available details
.. toctree::
- :maxdepth: 1
-
+ :maxdepth: 4
+
resourcesource
.. _TOSCA: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd01/TOSCA-Simple-Profile-YAML-v1.0-csprd01.html#DEFN_ENTITY_NODE_TYPE
.. |image0| image:: media/mandatory.JPG
- :width: 7.88889in
- :height: 4.43750in
-
+ :width: 400pt
+
.. |image1| image:: media/optional.JPG
- :width: 7.88889in
- :height: 4.43750in
\ No newline at end of file
+ :width: 400pt
\ No newline at end of file
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+Resource Source
+===============
+.. toctree::
+ :maxdepth: 4
+
+Input:
+------
+Expects the value to be provided as input to the request.
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "source-input" :
+ {
+ "description": "This is Input Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {},
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
+ }
+
+Default:
+--------
+Expects the value to be defaulted in the model itself.
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "source-default" :
+ {
+ "description": "This is Default Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {},
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
+ }
+
+Sql:
+----
+
+Expects the SQL query to be modeled; that SQL query can be parameterized, and the parameters be other resources resolved through other means. If that's the case, this data dictionary definition will have to define key-dependencies along with input-key-mapping.
+
+CDS is currently deployed along the side of SDNC, hence the primary database connection provided by the framework is to SDNC database.
+
+|image0|
+
+.. |image0| image:: media/sqltable.JPG
+ :width: 400pt
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "description": "This is Database Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
+ "required": true,
+ "type": "string",
+ "constraints": [
+ {
+ "valid_values": [
+ "SQL"
+ ]
+ }
+ ]
+ },
+ "endpoint-selector": {
+ "required": false,
+ "type": "string"
+ },
+ "query": {
+ "required": true,
+ "type": "string"
+ },
+ "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"
+ }
+
+Connection to a specific database can be expressed through the endpoint-selector property, which refers to a macro defining the information about the database the connect to. Understand TOSCA Macro in the context of CDS.
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "dsl_definitions": {
+ "dynamic-db-source": {
+ "type": "maria-db",
+ "url": "jdbc:mysql://localhost:3306/sdnctl",
+ "username": "<username>",
+ "password": "<password>"
+ }
+ }
+ }
+
+Rest:
+-----
+
+Expects the URI along with the VERB and the payload, if needed.
+
+CDS is currently deployed along the side of SDNC, hence the default rest connection provided by the framework is to SDNC MDSAL.
+
+|image1|
+
+.. |image1| image:: media/optional.JPG
+ :width: 400pt
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "description": "This is Rest Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
+ "required": false,
+ "type": "string",
+ "default": "JSON",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON"
+ ]
+ }
+ ]
+ },
+ "verb": {
+ "required": false,
+ "type": "string",
+ "default": "GET",
+ "constraints": [
+ {
+ "valid_values": [
+ "GET", "POST", "DELETE", "PUT"
+ ]
+ }
+ ]
+ },
+ "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",
+ "default": "JSON_PATH",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON_PATH",
+ "JSON_POINTER"
+ ]
+ }
+ ]
+ },
+ "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"
+ }
+
+Connection to a specific REST system can be expressed through the endpoint-selector property, which refers to a macro defining the information about the REST system the connect to. Understand TOSCA Macro in the context of CDS.
+
+Few ways are available to authenticate to the REST system:
+ * token-auth
+ * basic-auth
+ * ssl-basic-auth
+
+token-auth:
+~~~~~~~~~~~
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "dsl_definitions": {
+ "dynamic-rest-source": {
+ "type" : "token-auth",
+ "url" : "http://localhost:32778",
+ "token" : "<token>"
+ }
+ }
+ }
+
+basic-auth:
+~~~~~~~~~~~
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "dsl_definitions": {
+ "dynamic-rest-source": {
+ "type" : "basic-auth",
+ "url" : "http://localhost:32778",
+ "username" : "<username>",
+ "password": "<password>"
+ }
+ }
+ }
+
+ssl-basic-auth:
+~~~~~~~~~~~~~~~
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "dsl_definitions": {
+ "dynamic-rest-source": {
+ "type" : "ssl-basic-auth",
+ "url" : "http://localhost:32778",
+ "keyStoreInstance": "JKS or PKCS12",
+ "sslTrust": "trusture",
+ "sslTrustPassword": "<password>",
+ "sslKey": "keystore",
+ "sslKeyPassword": "<password>"
+ }
+ }
+ }
+
+Capability:
+-----------
+
+Expects a script to be provided.
+
+|image2|
+
+.. |image2| image:: media/capabilitytable.JPG
+ :width: 400pt
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "description": "This is Component Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "script-type": {
+ "required": true,
+ "type": "string",
+ "default": "kotlin",
+ "constraints": [
+ {
+ "valid_values": [
+ "kotlin",
+ "jython"
+ ]
+ }
+ ]
+ },
+ "script-class-reference": {
+ "description": "Capability reference name for internal and kotlin, for jython script file path",
+ "required": true,
+ "type": "string"
+ },
+ "instance-dependencies": {
+ "required": false,
+ "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "key-dependencies": {
+ "description": "Resource Resolution dependency dictionary names.",
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+ }
+
+Complex Type:
+-------------
+
+Value will be resolved through REST., and output will be a complex type.
+
+Modeling reference: Modeling Concepts#rest
+
+In this example, we're making a POST request to an IPAM system with no payload.
+
+Some ingredients are required to perform the query, in this case, $prefixId. Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding.
+
+As part of this request, the expected response will be as below.
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "id": 4,
+ "address": "192.168.10.2/32",
+ "vrf": null,
+ "tenant": null,
+ "status": 1,
+ "role": null,
+ "interface": null,
+ "description": "",
+ "nat_inside": null,
+ "created": "2018-08-30",
+ "last_updated": "2018-08-30T14:59:05.277820Z"
+ }
+
+What is of interest is the address and id fields. For the process to return these two values, we need to create a custom data-type, as bellow
+
+.. code-block:: json
+ :linenos:
+
+ {
+ "version": "1.0.0",
+ "description": "This is Netbox IP Data Type",
+ "properties": {
+ "address": {
+ "required": true,
+ "type": "string"
+ },
+ "id": {
+ "required": true,
+ "type": "integer"
+ }
+ },
+ "derived_from": "tosca.datatypes.Root"
+ }
+
+The type of the data dictionary will be dt-netbox-ip.
+
+To tell the resolution framework what is of interest in the response, the output-key-mapping section is used. The process will map the output-key-mapping to the defined data-type.
+
+.. code-block:: json
+
+ {
+ "tags" : "oam-local-ipv4-address",
+ "name" : "create_netbox_ip",
+ "property" : {
+ "description" : "netbox ip",
+ "type" : "dt-netbox-ip"
+ },
+ "updated-by" : "adetalhouet",
+ "sources" : {
+ "config-data" : {
+ "type" : "source-rest",
+ "properties" : {
+ "type" : "JSON",
+ "verb" : "POST",
+ "endpoint-selector" : "ipam-1",
+ "url-path" : "/api/ipam/prefixes/$prefixId/available-ips/",
+ "path" : "",
+ "input-key-mapping" : {
+ "prefixId" : "prefix-id"
+ },
+ "output-key-mapping" : {
+ "address" : "address",
+ "id" : "id"
+ },
+ "key-dependencies" : [ "prefix-id" ]
+ }
+ }
+ }
+ }
\ No newline at end of file
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+CDS Designer UI
+===============
-CDS Designer Guide
-==================
-
-**Table of Contents**
-
-- `Getting
- Started <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-GettingStarted>`__
-
-- `What is CDS Designer
- UI? <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-WhatIsCDS>`__
-
-- `What’s
- new? <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-WhatIsNew>`__
-
-- `Overview of CDS
- Interface <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-OverviewOfCDS>`__
-
-- `CBA
- Packages <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CBAPackages>`__
-
- - `Package
- list <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-PackageList>`__
-
- - `Create a CBA
- Package <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CreateNewCBAPackage>`__
-
- - `User
- Flow <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-UserFlow>`__
-
- - `Create a New
- Package <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CreateNewPackage>`__
-
- - `MetaData <#CDSDesignerGuide-MetaData>`__
-
- - `Template & Mapping <#CDSDesignerGuide-TemplateMapping>`__
-
- - `Scripts <#CDSDesignerGuide-Scripts>`__
-
- - `Definitions <#CDSDesignerGuide-Definitions>`__
+.. toctree::
+ :caption: Table of Contents
+ :maxdepth: 4
- - `External System Authentication
- Properties <#CDSDesignerGuide-ExternalSystem>`__
Getting Started
-===============
+---------------
This is your CDS Designer UI guide. No matter how experienced you are or
what you want to achieve, it should cover everything you need to know —
from navigating the interface to making the most of different features.
+
What is CDS Designer UI?
-========================
+------------------------
+----------------------------------------------+--------------+
| CDS Designer UI is a framework to automate | |
| CDS has both **design-time** and | |
| **run-time** activities; during design time, | |
| **Designer** can **define** what **actions** | |
-| are required for a given service, along with | |
-| anything comprising the action. The design | |
-| produces a `CBA | |
-| Package <https://wik | |
-| i.onap.org/display/DW/Modeling+Concepts#Mode | |
-| lingConcepts-ControllerBlueprintArchive>`__. | |
-| Its **content** is driven from a **catalog** | |
-| of **reusable data dictionary** and | |
-| **component**, delivering a reusable and | |
-| simplified **self-service** experience. | |
-| | |
-| CDS modeling is mainly based on **the TOSCA | |
-| standard**, using JSON as a representation. | |
+| are required for a given service, along with | |
+| anything comprising the action. The design | |
+| produces a `CBA | |
+| Package <https://wik | |
+| i.onap.org/display/DW/Modeling+Concepts#Mode | |
+| lingConcepts-ControllerBlueprintArchive>`__. | |
+| Its **content** is driven from a **catalog** | |
+| of **reusable data dictionary** and | |
+| **component**, delivering a reusable and | |
+| simplified **self-service** experience. | |
+| | |
+| CDS modeling is mainly based on **the TOSCA | |
+| standard**, using JSON as a representation. | |
+----------------------------------------------+--------------+
-.. _section-3:
What's new?
-===========
+-----------
+----------------------+----------------------+----------------------+
| |image2| | |image3| | |image4| |
| | management) | |
+----------------------+----------------------+----------------------+
+
Overview of CDS Interface
-=========================
+-------------------------
Full CDS UI screens are available in
`InVision <https://invis.io/PAUI9GLJH3Q>`__
4. **Module list:** View all active items in module and tools for search
and filtering
+
CBA Packages
-============
+------------
-- .. rubric:: Package List
- :name: package-list
+Package List
+~~~~~~~~~~~~
It gives you quick access to all and most recent created/edit packages
and Generic scripting) and by clicking on it, it will load to mode
screen
+
Create a New CBA Package
-========================
+------------------------
-- .. rubric:: User Flow
- :name: user-flow
+User Flow
+~~~~~~~~~
|image10|
-- .. rubric:: Create a New Package
- :name: create-a-new-package
+
+Create a New Package
+~~~~~~~~~~~~~~~~~~~~
You can create a new CBA Package by creating a new custom package or by
import package file that is already created before.
|image11|
-- .. rubric:: `MetaData <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-958933373>`__
- :name: metadata
+
+`MetaData <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-958933373>`__
+~~~~~~~~~
In **MetaData Tab,** select Package Mode, enter package Name, Version,
Description and other configurations
navigate to the top left in breadcrumb and click the **CBA Packages**
link or click on **Packages** link in the Main menu.
-- .. rubric:: `Template &
- Mapping <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--1256902502>`__
- :name: template-mapping
+
+`Template & Mapping <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--1256902502>`__
+~~~~~~~~~~~~~~~~~~~
You can create as many templates using
`artifact-mapping-resource <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-artifact-mapping-resource>`__
|image22|
-- .. rubric:: `Scripts <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--703799064>`__
- :name: scripts
+
+`Scripts <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--703799064>`__
+~~~~~~~~
Allowed file type: Kotlin(kt), Python(py)
To add script file/s, you have two options:
-1. **Enter file URL:** Script file can be stored in server and you can
- add this script file by copy and paste file URL in URL input then
- **press ENTER** key from the keyboard
+**Enter file URL:** Script file can be stored in server and you can add this script file by copy and paste file URL in URL input then
+**press ENTER** key from the keyboard
|image23|
-2. **Import File**
+**Import File**
|image24|
|image25|
-- .. rubric:: `Definitions <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-dataType>`__
- :name: definitions
+
+`Definitions <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-dataType>`__
+~~~~~~~~~~~~
Allowed file type: JSON
To define a data type that represents the **schema** of a specific type
of **data**, you have two options:
-1. ** Enter file URL:** Definition file can be stored in server and user can
- add this script file by copy and paste file URL in URL input then
- **press ENTER** key from the keyboard
+**Enter file URL:** Definition file can be stored in server and user can add this script file by copy and paste file URL in URL input then
+**press ENTER** key from the keyboard
|image26|
-2. **Import File**
+**Import File**
|image27|
|image28|
-- .. rubric:: `External System Authentication
- Properties <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-FlexiblePlugIn>`__
- :name: external-system-authentication-properties
+
+`External System Authentication Properties <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-FlexiblePlugIn>`__
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to populate the system information within the package, you have
to provide **dsl_definitions**
|image29|
-.. |image1| image:: https://wiki.onap.org/download/attachments/84650426/CDS%20Logo.png?version=1&modificationDate=1591034588000&api=v2
+.. |image1| image:: https://wiki.onap.org/download/attachments/84650426/CDS%20Logo.png?version=1&modificationDate=1591034588000&api=v2
:width: 200pt
.. |image2| image:: https://wiki.onap.org/download/thumbnails/84650426/Feature%201.png?version=1&modificationDate=1591032224000&api=v2
:width: 50pt
:width: 500pt
.. |image28| image:: https://wiki.onap.org/download/attachments/84650426/Definitions%203.jpg?version=1&modificationDate=1591639556000&api=v2
:width: 500pt
-.. |image29| image:: https://wiki.onap.org/download/attachments/84650426/External%20system.jpg?version=1&modificationDate=1591639581000&api=v2
+.. |image29| image:: https://wiki.onap.org/download/attachments/84650426/External%20system.jpg?version=1&modificationDate=1591639581000&api=v2
:width: 500pt
\ No newline at end of file
--- /dev/null
+{
+ "info": {
+ "_postman_id": "295cc7b7-a544-44f5-8045-54effcd41108",
+ "name": "CDS PNF Simulator Use Case",
+ "description": "This collection contains all API calls to do the \"PNF Simulator Day-N config-assign and config-deploy use case\" in CDS. ",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "Bootstrap",
+ "protocolProfileBehavior": {
+ "disabledSystemHeaders": {}
+ },
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "type": "text",
+ "value": "",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n\"loadModelType\" : true,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : true\r\n}",
+ "options": {
+ "raw": {}
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/bootstrap",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model",
+ "bootstrap"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "CDS Bootstrap",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "value": "",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n\"loadModelType\" : false,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : false\r\n}",
+ "options": {
+ "raw": {}
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8081/api/v1/blueprint-model/bootstrap",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8081",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model",
+ "bootstrap"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "X-ONAP-RequestID",
+ "value": "b73253b6-d2be-4701-bdb2-31fa66b79a01"
+ },
+ {
+ "key": "X-ONAP-InvocationID",
+ "value": "b1a59296-fcf2-4435-b8de-9a2e9b9f4077"
+ },
+ {
+ "key": "X-ONAP-PartnerName",
+ "value": "cds-controller"
+ },
+ {
+ "key": "Vary",
+ "value": "Origin"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Method"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Headers"
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Content-Length",
+ "value": "0"
+ },
+ {
+ "key": "Cache-Control",
+ "value": "no-cache, no-store, max-age=0, must-revalidate"
+ },
+ {
+ "key": "Pragma",
+ "value": "no-cache"
+ },
+ {
+ "key": "Expires",
+ "value": "0"
+ },
+ {
+ "key": "X-Content-Type-Options",
+ "value": "nosniff"
+ },
+ {
+ "key": "X-Frame-Options",
+ "value": "DENY"
+ },
+ {
+ "key": "X-XSS-Protection",
+ "value": "1 ; mode=block"
+ },
+ {
+ "key": "Referrer-Policy",
+ "value": "no-referrer"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ },
+ {
+ "name": "Get Blueprints",
+ "protocolProfileBehavior": {
+ "disableBodyPruning": true
+ },
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "value": "",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n\"loadModelType\" : true,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : false\r\n}",
+ "options": {
+ "raw": {}
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "CDS Bootstrap",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "value": "",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n\"loadModelType\" : false,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : false\r\n}",
+ "options": {
+ "raw": {}
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8081/api/v1/blueprint-model/bootstrap",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8081",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model",
+ "bootstrap"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "X-ONAP-RequestID",
+ "value": "b73253b6-d2be-4701-bdb2-31fa66b79a01"
+ },
+ {
+ "key": "X-ONAP-InvocationID",
+ "value": "b1a59296-fcf2-4435-b8de-9a2e9b9f4077"
+ },
+ {
+ "key": "X-ONAP-PartnerName",
+ "value": "cds-controller"
+ },
+ {
+ "key": "Vary",
+ "value": "Origin"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Method"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Headers"
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Content-Length",
+ "value": "0"
+ },
+ {
+ "key": "Cache-Control",
+ "value": "no-cache, no-store, max-age=0, must-revalidate"
+ },
+ {
+ "key": "Pragma",
+ "value": "no-cache"
+ },
+ {
+ "key": "Expires",
+ "value": "0"
+ },
+ {
+ "key": "X-Content-Type-Options",
+ "value": "nosniff"
+ },
+ {
+ "key": "X-Frame-Options",
+ "value": "DENY"
+ },
+ {
+ "key": "X-XSS-Protection",
+ "value": "1 ; mode=block"
+ },
+ {
+ "key": "Referrer-Policy",
+ "value": "no-referrer"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ },
+ {
+ "name": "Data Dictionary",
+ "event": [
+ {
+ "listen": "prerequest",
+ "script": {
+ "id": "c927b543-b143-4ab9-963c-6289a7d1040e",
+ "exec": [
+ "var allDD = pm.environment.get(\"allDD\");\r",
+ "\r",
+ "if (!(allDD instanceof Array)) {\r",
+ " var allDD = [\r",
+ " {\r",
+ "\t\t\"name\": \"netconf-password\",\r",
+ "\t\t\"tags\": \"netconf-password\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"netconf-password\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"netconf-password\",\r",
+ "\t\t\t\"name\": \"netconf-password\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"netconf-password string attribute\",\r",
+ "\t\t\t\t\"type\": \"string\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-input\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\t},\r",
+ "\t{\r",
+ "\t\t\"name\": \"netconf-username\",\r",
+ "\t\t\"tags\": \"netconf-username\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"netconf-username\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"netconf-username\",\r",
+ "\t\t\t\"name\": \"netconf-username\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"netconf-username string attribute\",\r",
+ "\t\t\t\t\"type\": \"string\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-input\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\t},\r",
+ "\t{\r",
+ "\t\t\"name\": \"netconf-server-port\",\r",
+ "\t\t\"tags\": \"netconf-server-port\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"netconf-server-port\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"netconf-server-port\",\r",
+ "\t\t\t\"name\": \"netconf-server-port\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"netconf-server-port string attribute\",\r",
+ "\t\t\t\t\"type\": \"string\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-input\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\t},\r",
+ "\t{\r",
+ "\t\t\"name\": \"pnf-id\",\r",
+ "\t\t\"tags\": \"pnf-id\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"pnf-id\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"pnf-id\",\r",
+ "\t\t\t\"name\": \"pnf-id\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"pnf-id string attribute\",\r",
+ "\t\t\t\t\"type\": \"string\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-input\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\t},\r",
+ "\t{\r",
+ "\r",
+ "\t\t\"name\": \"pnf-ipv4-address\",\r",
+ "\t\t\"tags\": \"pnf-ipv4-address\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"pnf-ipv4-address\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"pnf-ipv4-address\",\r",
+ "\t\t\t\"name\": \"pnf-ipv4-address\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"pnf-ipv4-address string attribute\",\r",
+ "\t\t\t\t\"type\": \"string\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-input\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\r",
+ "\t},\r",
+ "\t{\r",
+ "\t\t\"name\": \"stream-count\",\r",
+ "\t\t\"tags\": \"stream-count\",\r",
+ "\t\t\"data_type\": \"string\",\r",
+ "\t\t\"description\": \"stream-count\",\r",
+ "\t\t\"entry_schema\": \"string\",\r",
+ "\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"updatedBy\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\"definition\": {\r",
+ "\t\t\t\"tags\": \"stream-count\",\r",
+ "\t\t\t\"name\": \"stream-count\",\r",
+ "\t\t\t\"property\": {\r",
+ "\t\t\t\t\"description\": \"stream-count string attribute\",\r",
+ "\t\t\t\t\"type\": \"integer\"\r",
+ "\t\t\t},\r",
+ "\t\t\t\"updated-by\": \"Aarna service <vmuthukrishnan@aarnanetworks.com>\",\r",
+ "\t\t\t\"sources\": {\r",
+ "\t\t\t\t\"input\": {\r",
+ "\t\t\t\t\t\"type\": \"source-default\",\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\t\t\t\t},\r",
+ "\t\t\t\t\"default\": {\r",
+ "\r",
+ "\t\t\t\t\t\"type\": \"source-default\",\r",
+ "\r",
+ "\t\t\t\t\t\"properties\": {}\r",
+ "\r",
+ "\t\t\t\t}\r",
+ "\t\t\t}\r",
+ "\t\t}\r",
+ "\t}]\r",
+ "}\r",
+ "\r",
+ "\r",
+ "var currentDD = JSON.stringify(allDD.shift());\r",
+ "pm.environment.set(\"DataDictionary\", currentDD);\r",
+ "console.log(currentDD);\r",
+ "pm.environment.set(\"allDD\", allDD);\r",
+ "\r",
+ "\r",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ },
+ {
+ "listen": "test",
+ "script": {
+ "id": "bd26b9e6-4237-4591-a037-0520f737439f",
+ "exec": [
+ "var allDD = pm.environment.get(\"allDD\");\r",
+ "\r",
+ "if (allDD instanceof Array && allDD.length > 0) {\r",
+ " postman.setNextRequest(\"Data Dictionary\");\r",
+ "} else {\r",
+ " postman.setNextRequest(null);\r",
+ " allDD = null;\r",
+ "}"
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{{DataDictionary}}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/dictionary",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "dictionary"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Enrich Blueprint",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Accept-Encoding",
+ "value": "gzip,deflate",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Referer",
+ "value": "http://84.39.39.116:30497/blueprint",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Origin",
+ "value": "http://84.39.39.116:30497",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "formdata",
+ "formdata": [
+ {
+ "key": "file",
+ "type": "file",
+ "src": "/home/jakob/CDS_Use_Cases/PNF-DEMO-ENRICHED_WORKING/pnf-demo.zip"
+ }
+ ],
+ "options": {
+ "formdata": {}
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/enrich",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model",
+ "enrich"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Save Blueprint",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "type": "text",
+ "value": "",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "formdata",
+ "formdata": [
+ {
+ "key": "file",
+ "type": "file",
+ "src": "/home/jakob/CDS_Use_Cases/PNF-DEMO-ENRICHED_WORKING/pnf-demo.zip"
+ }
+ ],
+ "options": {
+ "formdata": {}
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "CDS Bootstrap",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "",
+ "value": "",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n\"loadModelType\" : false,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : false\r\n}",
+ "options": {
+ "raw": {}
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8081/api/v1/blueprint-model/bootstrap",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8081",
+ "path": [
+ "api",
+ "v1",
+ "blueprint-model",
+ "bootstrap"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "X-ONAP-RequestID",
+ "value": "b73253b6-d2be-4701-bdb2-31fa66b79a01"
+ },
+ {
+ "key": "X-ONAP-InvocationID",
+ "value": "b1a59296-fcf2-4435-b8de-9a2e9b9f4077"
+ },
+ {
+ "key": "X-ONAP-PartnerName",
+ "value": "cds-controller"
+ },
+ {
+ "key": "Vary",
+ "value": "Origin"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Method"
+ },
+ {
+ "key": "Vary",
+ "value": "Access-Control-Request-Headers"
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Content-Length",
+ "value": "0"
+ },
+ {
+ "key": "Cache-Control",
+ "value": "no-cache, no-store, max-age=0, must-revalidate"
+ },
+ {
+ "key": "Pragma",
+ "value": "no-cache"
+ },
+ {
+ "key": "Expires",
+ "value": "0"
+ },
+ {
+ "key": "X-Content-Type-Options",
+ "value": "nosniff"
+ },
+ {
+ "key": "X-Frame-Options",
+ "value": "DENY"
+ },
+ {
+ "key": "X-XSS-Protection",
+ "value": "1 ; mode=block"
+ },
+ {
+ "key": "Referrer-Policy",
+ "value": "no-referrer"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ },
+ {
+ "name": "Create Config Assign Day-1",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Accept-Encoding",
+ "value": "gzip,deflate",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Referer",
+ "value": "http://84.39.39.116:30497/blueprint",
+ "type": "text",
+ "disabled": true
+ },
+ {
+ "key": "Origin",
+ "value": "http://84.39.39.116:30497",
+ "type": "text",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"actionIdentifiers\": {\n \"mode\": \"sync\",\n \"blueprintName\": \"pnf_netconf\",\n \"blueprintVersion\": \"1.0.0\",\n \"actionName\": \"config-assign\"\n },\n \"payload\": {\n \"config-assign-request\": {\n \"template-prefix\": [\n \"pnf\", \"netconfrpc\"\n ],\n \"resolution-key\": \"day-1\",\n \"config-assign-properties\": {\n \"pnf-id\": \"abcd\",\n \"pnf-ipv4-address\": \"172.17.0.2\",\n \"netconf-password\": \"netconf\",\n \"netconf-username\": \"netconf\",\n \"netconf-server-port\": \"830\",\n \"stream-count\": 5\n }\n }\n },\n \"commonHeader\": {\n \"subRequestId\": \"143748f9-3cd5-4910-81c9-a4601ff2ea58\",\n \"requestId\": \"e5eb1f1e-3386-435d-b290-d49d8af8db4c\",\n \"originatorId\": \"SDNC_DG\"\n }\n}",
+ "options": {
+ "formdata": {},
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/execution-service/process",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "execution-service",
+ "process"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Create Config Assign Day-2",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json",
+ "disabled": true
+ },
+ {
+ "key": "Accept-Encoding",
+ "type": "text",
+ "value": "gzip,deflate",
+ "disabled": true
+ },
+ {
+ "key": "Referer",
+ "type": "text",
+ "value": "http://84.39.39.116:30497/blueprint",
+ "disabled": true
+ },
+ {
+ "key": "Origin",
+ "type": "text",
+ "value": "http://84.39.39.116:30497",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"actionIdentifiers\": {\n \"mode\": \"sync\",\n \"blueprintName\": \"pnf_netconf\",\n \"blueprintVersion\": \"1.0.0\",\n \"actionName\": \"config-assign\"\n },\n \"payload\": {\n \"config-assign-request\": {\n \"template-prefix\": [\n \"pnf\", \"netconfrpc\"\n ],\n \"resolution-key\": \"day-2\",\n \"config-assign-properties\": {\n \"pnf-id\": \"abcd\",\n \"pnf-ipv4-address\": \"172.17.0.2\",\n \"netconf-password\": \"netconf\",\n \"netconf-username\": \"netconf\",\n \"netconf-server-port\": \"830\",\n \"stream-count\": 10\n }\n }\n },\n \"commonHeader\": {\n \"subRequestId\": \"143748f9-3cd5-4910-81c9-a4601ff2ea58\",\n \"requestId\": \"e5eb1f1e-3386-435d-b290-d49d8af8db4c\",\n \"originatorId\": \"SDNC_DG\"\n }\n}",
+ "options": {
+ "formdata": {},
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/execution-service/process",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "execution-service",
+ "process"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Config Assign Day-1 Deploy",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json",
+ "disabled": true
+ },
+ {
+ "key": "Accept-Encoding",
+ "type": "text",
+ "value": "gzip,deflate",
+ "disabled": true
+ },
+ {
+ "key": "Referer",
+ "type": "text",
+ "value": "http://84.39.39.116:30497/blueprint",
+ "disabled": true
+ },
+ {
+ "key": "Origin",
+ "type": "text",
+ "value": "http://84.39.39.116:30497",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n\t\"actionIdentifiers\": {\n\t\t\"mode\": \"sync\",\n\t\t\"blueprintName\": \"pnf_netconf\",\n\t\t\"blueprintVersion\": \"1.0.0\",\n\t\t\"actionName\": \"config-deploy\"\n\t},\n\t\"payload\": {\n\t\t\"config-deploy-request\": {\n\t\t\t\"resolution-key\": \"day-1\",\n\t\t\t\"config-deploy-properties\": {\n\t\t\t\t\"pnf-id\": \"abcd\",\n\t\t\t\t\"pnf-ipv4-address\": \"172.17.0.2\",\n\t\t\t\t\"netconf-password\": \"netconf\",\n\t\t\t\t\"netconf-username\": \"netconf\"\n\t\t\t}\n\t\t}\n\t}\n\n\t,\n\t\"commonHeader\": {\n\t\t\"subRequestId\": \"143748f9-3cd5-4910-81c9-a4601ff2ea58\",\n\t\t\"requestId\": \"e5eb1f1e-3386-435d-b290-d49d8af8db4c\",\n\t\t\"originatorId\": \"SDNC_DG\"\n\t}\n}\n",
+ "options": {
+ "formdata": {},
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/execution-service/process",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "execution-service",
+ "process"
+ ]
+ }
+ },
+ "response": []
+ }
+ ],
+ "event": [
+ {
+ "listen": "prerequest",
+ "script": {
+ "id": "1d6b0502-1031-4cec-adec-6a02e2505fb2",
+ "type": "text/javascript",
+ "exec": [
+ ""
+ ]
+ }
+ },
+ {
+ "listen": "test",
+ "script": {
+ "id": "a97568b2-3520-450b-89c0-c344945c40e4",
+ "type": "text/javascript",
+ "exec": [
+ ""
+ ]
+ }
+ }
+ ],
+ "variable": [
+ {
+ "id": "f593c13c-9ebc-4b88-9622-a08889662808",
+ "key": "host",
+ "value": "localhost"
+ },
+ {
+ "id": "bcefbf57-f5df-41e3-be88-c3af5b76f916",
+ "key": "port",
+ "value": "8081"
+ }
+ ],
+ "protocolProfileBehavior": {}
+}
\ No newline at end of file
--- /dev/null
+.. This work is a derivative of https://wiki.onap.org/display/DW/PNF+Simulator+Day-N+config-assign+and+config-deploy+use+case
+.. This work is licensed under a Creative Commons Attribution 4.0
+.. International License. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Deutsche Telekom AG.
+
+PNF Simulator Day-N config-assign/deploy
+========================================
+
+Overview
+~~~~~~~~~~
+
+This use case shows in a very simple way how a blueprint model of a PNF is created in CDS and how the day-n configuration is
+assigned and deployed through CDS. A Netconf server (docker image `sysrepo/sysrepo-netopeer2`) is used for simulating the PNF.
+
+This use case (POC) solely requires a running CDS and the PNF Simulator running on a VM (Ubuntu is used by the author).
+No other module of ONAP is needed.
+
+There are different ways to run CDS, to run PNF simulator and to do configuration deployment. This guide will show
+different possible options to allow the greatest possible flexibility.
+
+Run CDS (Blueprint Processor)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+CDS can be run in Kubernetes (Minikube, Microk8s) or in an IDE. You can choose your favorite option.
+Just the blueprint processor of CDS is needed. If you have desktop access it is recommended to run CDS in an IDE since
+it is easy and enables debugging.
+
+* CDS in Microk8s: https://wiki.onap.org/display/DW/Running+CDS+on+Microk8s (RDT link to be added)
+* CDS in Minikube: https://wiki.onap.org/display/DW/Running+CDS+in+minikube (RDT link to be added)
+* CDS in an IDE: https://docs.onap.org/projects/onap-ccsdk-cds/en/latest/userguide/running-bp-processor-in-ide.html
+
+Run PNF Simulator and install module
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are many different ways to run a Netconf Server to simulate the PNF, in this guide `sysrepo/sysrepo-netopeer2`
+docker image is commonly used. The easiest way is to run the out-of-the-box docker container without any
+other configuration, modules or scripts. In the ONAP community there are other workflows existing for running the
+PNF Simulator. These workflows are also using `sysrepo/sysrepo-netopeer2` docker image. These workflow are also linked
+here but they are not tested by the author of this guide.
+
+.. tabs::
+
+ .. tab:: sysrepo/sysrepo-netopeer2 (latest)
+
+ .. warning::
+ Currently there is an issue for the SSH connection between CDS and the netconf server because of unmatching
+ exchange key algorhithms
+ (see `Stackoverflow <https://stackoverflow.com/questions/64047502/java-lang-illegalstateexception-unable-to-negotiate-key-exchange-for-server-hos>`_).
+ **Use legacy version (right tab) until the issue is resolved.**
+
+ Download and run docker container with ``docker run -d --name netopeer2 -p 830:830 -p 6513:6513 sysrepo/sysrepo-netopeer2:latest``
+
+ Enter the container with ``docker exec -it netopeer2 bin/bash``
+
+ Browse to the target location where all YANG modules exist: ``cd /etc/sysrepo/yang``
+
+ Create a simple mock YANG model for a packet generator (:file:`pg.yang`).
+
+ .. code-block:: sh
+ :caption: **pg.yang**
+
+ module sample-plugin {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:sample-plugin";
+ prefix "sample-plugin";
+
+ description
+ "This YANG module defines the generic configuration and
+ operational data for sample-plugin in VPP";
+
+ revision "2016-09-18" {
+ description "Initial revision of sample-plugin model";
+ }
+
+ container sample-plugin {
+
+ uses sample-plugin-params;
+ description "Configuration data of sample-plugin in Honeycomb";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/config/sample-plugin:sample-plugin
+
+ // WRITE
+ // curl http://localhost:8181/restconf/operational/sample-plugin:sample-plugin
+
+ }
+
+ grouping sample-plugin-params {
+ container pg-streams {
+ list pg-stream {
+
+ key id;
+ leaf id {
+ type string;
+ }
+
+ leaf is-enabled {
+ type boolean;
+ }
+ }
+ }
+ }
+ }
+
+ Create the following sample XML data definition for the above model (:file:`pg-data.xml`).
+ Later on this will initialise one single PG stream.
+
+ .. code-block:: sh
+ :caption: **pg-data.xml**
+
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+
+ Execute the following command within netopeer docker container to install the pg.yang model
+
+ .. code-block:: sh
+
+ sysrepoctl -v3 -i pg.yang
+
+ .. note::
+ This command will just schedule the installation, it will be applied once the server is restarted.
+
+ Stop the container from outside with ``docker stop netopeer2`` and start it again with ``docker start netopeer2``
+
+ Enter the container like it's mentioned above with ``docker exec -it netopeer2 bin/bash``.
+
+ You can check all installed modules with ``sysrepoctl -l``. `sample-plugin` module should appear with ``I`` flag.
+
+ Execute the following the commands to initialise the Yang model with one pg-stream record.
+ We will be using CDS to perform the day-1 and day-2 configuration changes.
+
+ .. code-block:: sh
+
+ netopeer2-cli
+ > connect --host localhost --login root
+ # passwort is root
+ > get --filter-xpath /sample-plugin:*
+ # shows existing pg-stream records (empty)
+ > edit-config --target running --config=/etc/sysrepo/yang/pg-data.xml
+ # initialises Yang model with one pg-stream record
+ > get --filter-xpath /sample-plugin:*
+ # shows initialised pg-stream
+
+ If the output of the last command is like this, everything went successful:
+
+ .. code-block:: sh
+
+ DATA
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+
+
+ .. tab:: sysrepo/sysrepo-netopeer2 (legacy)
+
+ Download and run docker container with ``docker run -d --name netopeer2 -p 830:830 -p 6513:6513 sysrepo/sysrepo-netopeer2:legacy``
+
+ Enter the container with ``docker exec -it netopeer2 bin/bash``
+
+ Browse to the target location where all YANG modules exist: ``cd /opt/dev/sysrepo/yang``
+
+ Create a simple mock YANG model for a packet generator (:file:`pg.yang`).
+
+ .. code-block:: sh
+ :caption: **pg.yang**
+
+ module sample-plugin {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:sample-plugin";
+ prefix "sample-plugin";
+
+ description
+ "This YANG module defines the generic configuration and
+ operational data for sample-plugin in VPP";
+
+ revision "2016-09-18" {
+ description "Initial revision of sample-plugin model";
+ }
+
+ container sample-plugin {
+
+ uses sample-plugin-params;
+ description "Configuration data of sample-plugin in Honeycomb";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/config/sample-plugin:sample-plugin
+
+ // WRITE
+ // curl http://localhost:8181/restconf/operational/sample-plugin:sample-plugin
+
+ }
+
+ grouping sample-plugin-params {
+ container pg-streams {
+ list pg-stream {
+
+ key id;
+ leaf id {
+ type string;
+ }
+
+ leaf is-enabled {
+ type boolean;
+ }
+ }
+ }
+ }
+ }
+
+ Create the following sample XML data definition for the above model (:file:`pg-data.xml`).
+ Later on this will initialise one single PG (packet-generator) stream.
+
+ .. code-block:: sh
+ :caption: **pg-data.xml**
+
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+
+ Execute the following command within netopeer docker container to install the pg.yang model
+
+ .. code-block:: sh
+
+ sysrepoctl -i -g pg.yang
+
+ You can check all installed modules with ``sysrepoctl -l``. `sample-plugin` module should appear with ``I`` flag.
+
+ In legacy version of `sysrepo/sysrepo-netopeer2` subscribers of a module are required, otherwise they are not
+ running and configurations changes are not accepted, see https://github.com/sysrepo/sysrepo/issues/1395. There is
+ an predefined application mock up which can be used for that. The usage is described
+ here: https://asciinema.org/a/160247. You need to run the following
+ commands to start the example application for subscribing to our sample-plugin YANG module.
+
+ .. code-block:: sh
+
+ cd /opt/dev/sysrepo/build/examples
+ ./application_example sample-plugin
+
+ Following output should appear:
+
+ .. code-block:: sh
+
+ ========== READING STARTUP CONFIG sample-plugin: ==========
+
+ /sample-plugin:sample-plugin (container)
+ /sample-plugin:sample-plugin/pg-streams (container)
+
+
+ ========== STARTUP CONFIG sample-plugin APPLIED AS RUNNING ==========
+
+
+ The terminal session needs to be kept open after application has started.
+
+ Open a new terminal and enter the container with ``docker exec -it netopeer2 bin/bash``.
+ Execute the following commands in the container to initialise the Yang model with one pg-stream record.
+ We will be using CDS to perform the day-1 configuration and day-2 configuration changes.
+
+ .. code-block:: sh
+
+ netopeer2-cli
+ > connect --host localhost --login netconf
+ # passwort is netconf
+ > get --filter-xpath /sample-plugin:*
+ # shows existing pg-stream records (empty)
+ > edit-config --target running --config=/opt/dev/sysrepo/yang/pg-data.xml
+ # initialises Yang model with one pg-stream record
+ > get --filter-xpath /sample-plugin:*
+ # shows initialised pg-stream
+
+ If the output of the last command is like this, everything went successful:
+
+ .. code-block:: sh
+
+ DATA
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+
+ You can also see that there are additional logs in the subscriber application after editing the configuration of our
+ YANG module.
+
+ .. tab:: PNF simulator integration project
+
+ .. warning::
+ This method of setting up the PNF simulator is not tested by the author of this guide
+
+ You can refer to `PnP PNF Simulator wiki page <https://wiki.onap.org/display/DW/PnP+PNF+Simulator>`_
+ to clone the GIT repo and start the required docker containers. We are interested in the
+ `sysrepo/sysrepo-netopeer2` docker container to load a simple YANG similar to vFW Packet Generator.
+
+ Start PNF simulator docker containers. You can consider changing the netopeer image verion to image:
+ `sysrepo/sysrepo-netopeer2:iop` in docker-compose.yml file If you find any issues with the default image.
+
+ .. code-block:: sh
+
+ cd $HOME
+
+ git clone https://github.com/onap/integration.git
+
+ Start PNF simulator
+
+ cd ~/integration/test/mocks/pnfsimulator
+
+ ./simulator.sh start
+
+ Verify that you have netopeer docker container are up and running. It will be mapped to host port 830.
+
+ .. code-block:: sh
+
+ docker ps -a | grep netopeer
+
+
+Config-assign and config-deploy in CDS
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In the following steps the CBA is published in CDS, config-assignment is done and the config is deployed to to the
+Netconf server through CDS in the last step. We will use this CBA: :download:`zip <media/pnf-simulator-demo-cba.zip>`.
+If you want to use scripts instead of Postman the CBA also contains all necessary scripts.
+
+.. tabs::
+
+ .. tab:: Scripts
+
+ **There will be different scripts depending on your CDS installation. For running it in an IDE always use scripts with**
+ **-ide.sh prefix. For running CDS in Kubernetes use scripts with -k8s.sh ending. In scripts with -ide.sh prefix**
+ **host will be localhost and port will be 8081. For K8s host ip adress gets automatically detected, port is 8000.**
+
+ **Set up CDS:**
+
+ Unzip the downloaded CBA and go to ``/Scripts/`` directory.
+
+ The below script will call Bootstrap API of CDS which loads the CDS default model artifacts into CDS DB.
+ You should get HTTP status 200 for the below command.
+
+ .. code-block:: sh
+
+ bash -x ./bootstrap-cds-ide.sh
+ # bash -x ./bootstrap-cds-k8s.sh
+
+ Call ``bash -x ./get-cds-blueprint-models-ide.sh`` / ``bash -x ./get-cds-blueprint-models-k8s.sh`` to get all blueprint models in the CDS database.
+ You will see a default model ``"artifactName": "vFW-CDS"`` which was loaded by calling bootstrap.
+
+ Push the PNF CDS blueprint model data dictionary to CDS by calling ``bash -x ./dd-microk8s-ide.sh ./dd.json`` /
+ ``bash -x ./dd-microk8s-k8s.sh ./dd.json``.
+ This will call the data dictionary endpoint of CDS.
+
+ Check CDS database for PNF data dictionaries by entering the DB. You should see 6 rows as shown below.
+
+ **For running CDS in an IDE (accessing mariadb container):**
+
+ .. code-block:: sh
+
+ sudo docker exec -it mariadb_container_id mysql -uroot -psdnctl
+ > USE sdnctl;
+ > select name, data_type from RESOURCE_DICTIONARY where updated_by='Aarna service <vmuthukrishnan@aarnanetworks.com>';
+
+ +---------------------+-----------+
+ | name | data_type |
+ +---------------------+-----------+
+ | netconf-password | string |
+ | netconf-server-port | string |
+ | netconf-username | string |
+ | pnf-id | string |
+ | pnf-ipv4-address | string |
+ | stream-count | integer |
+ +---------------------+-----------+
+
+ quit
+
+ Replace the container id with your running mariadb container id.
+
+
+ **For running CDS in K8s (accessing MariaDB pod):**
+
+ .. code-block:: sh
+
+ ./connect-cds-mariadb-k8s.sh
+
+ select name, data_type from RESOURCE_DICTIONARY where updated_by='Aarna service <vmuthukrishnan@aarnanetworks.com>';
+
+ +---------------------+-----------+
+ | name | data_type |
+ +---------------------+-----------+
+ | netconf-password | string |
+ | netconf-server-port | string |
+ | netconf-username | string |
+ | pnf-id | string |
+ | pnf-ipv4-address | string |
+ | stream-count | integer |
+ +---------------------+-----------+
+
+ quit
+
+ **Enrichment:**
+
+ Move to the main folder of the CBA with ``cd ..`` and archive all folders with ``zip -r pnf-demo.zip *``.
+
+ .. warning::
+ The provided CBA is already enriched, the following step anyhow will enrich the CBA again to show the full workflow.
+ For Frankfurt release this causes an issue when the configuration is deployed later on. This happens because some parameters
+ get deleted when enrichment is done a second time. Skip the next step until Deploy/Save Blueprint if you use
+ Frankfurt release and use the CBA as it is. In future this step should be fixed and executed based on an unenriched CBA.
+
+ Enrich the blueprint through calling the following script. Take care to provide the zip file you downloader earlier.
+
+ .. code-block:: sh
+
+ cd Scripts
+ bash -x ./enrich-and-download-cds-blueprint-ide.sh ../pnf-demo.zip
+ # bash -x ./enrich-and-download-cds-blueprint-k8s.sh ../pnf-demo.zip
+
+ Go to the enriched CBA folder with ``cd /tmp/CBA/`` and unzip with ``unzip pnf-demo.zip``.
+
+ **Deploy/Save the Blueprint into CDS database**
+
+ Go to Scripts folder with ``cd Scripts``.
+
+ Run the following script to save/deploy the Blueprint into the CDS database.
+
+ .. code-block:: sh
+
+ bash -x ./save-enriched-blueprint-ide.sh ../pnf-demo.zip
+ # bash -x ./save-enriched-blueprint-k8s.sh ../pnf-demo.zip
+
+ After that you should see the new model "artifactName": "pnf_netconf" by calling ``bash -x ./get-cds-blueprint-models.sh``
+
+ **Config-Assign**
+
+ The assumption is that we are using the same host to run PNF NETCONF simulator as well as CDS. You will need the
+ IP Adress of the Netconf server container which can be found out with
+ ``docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' netopeer2``. In the
+ following examples we will use 172.17.0.2.
+
+ Day-1 configuration:
+
+ .. code-block:: sh
+
+ bash -x ./create-config-assing-data-ide.sh day-1 172.17.0.2 5
+ # bash -x ./create-config-assing-data-k8s.sh day-1 172.17.0.2 5
+
+ You can verify the day-1 NETCONF RPC payload looking into CDS DB. You should see the NETCONF RPC with 5
+ streams (fw_udp_1 TO fw_udp_5). Connect to the DB like mentioned above and run the below statement. You should
+ see the day-1 configuration as an output.
+
+ .. code-block:: sh
+
+ MariaDB [sdnctl]> select * from TEMPLATE_RESOLUTION where resolution_key='day-1' AND artifact_name='netconfrpc';
+
+ <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
+ <edit-config>
+ <target>
+ <running/>
+ </target>
+ <config>
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ </config>
+ </edit-config>
+ </rpc>
+
+ Create PNF configuration for resolution-key = day-2 (stream-count = 10).
+ You can verify the CURL command JSON pay load file /tmp/day-n-pnf-config.json
+
+ .. code-block:: sh
+
+ bash -x ./create-config-assing-data-ide.sh day-2 172.17.0.2 10
+ # bash -x ./create-config-assing-data-k8s.sh day-2 172.17.0.2 10
+
+ You can verify the day-2 NETCONF RPC payload looking into CDS DB. You should see the NETCONF RPC with 10
+ streams (fw_udp_1 TO fw_udp_10). Connect to the DB like mentioned above and run the below statement. You should
+ see the day-2 configuration as an output.
+
+ .. code-block:: sh
+
+ MariaDB [sdnctl]> select * from TEMPLATE_RESOLUTION where resolution_key='day-2' AND artifact_name='netconfrpc';
+
+ <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
+ <edit-config>
+ <target>
+ <running/>
+ </target>
+ <config>
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_6</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_7</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_8</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_9</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_10</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ </config>
+ </edit-config>
+ </rpc>
+
+ .. note::
+ Until this step CDS did not interact with the PNF simulator or device. We just created the day-1 and day-2
+ configurations and stored it in CDS database
+
+ **Config-Deploy:**
+
+ Now we will make the CDS REST API calls to push the day-1 and day-2 configuration changes to the PNF simulator.
+
+ If you run CDS in Kubernetes open a new terminal and keep it running with ``bash -x ./tail-cds-bp-log.sh``,
+ we can use this to review the config-deploy actions. If you run CDS in an IDE you can have a look into the IDE terminal.
+
+ Following command will deploy day-1 configuration.
+ Syntax is ``# bash -x ./process-config-deploy.sh RESOLUTION_KEY PNF_IP_ADDRESS``
+
+ .. code-block:: sh
+
+ bash -x ./process-config-deploy-ide.sh day-1 127.17.0.2
+ # bash -x ./process-config-deploy-k8s.sh day-1 127.17.0.2
+
+ Go back to PNF netopeer cli console like mentioned above and verify if you can see 5 streams fw_udp_1 to fw_udp_5 enabled. If the 5 streams
+ appear in the output as follows, the day-1 configuration got successfully deployed and the use case is successfully done.
+
+ .. code-block:: sh
+
+ > get --filter-xpath /sample-plugin:*
+ DATA
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ >
+
+ The same can be done for day-2 config (follow same steps just with day-2 configuration).
+
+ .. note::
+ Through deployment we did not deploy the PNF, we just modified the PNF. The PNF could also be installed by CDS
+ but this is not targeted in this guide.
+
+ .. tab:: Postman
+
+ Download the Postman collection :download:`json <media/pnf-simulator.postman_collection.json>` and import it into
+ your Postman application. Set the collection variables `ip adress` and `port` depending on your CDS installation.
+ This can be done by right clicking the collection, click `edit` and then go to variables.
+ For running CDS in an IDE host should be localhost and port should be 8081. If you run CDS in Kubernetes you can find
+ out ip adress and port number of CDS blueprint processor by executing following command:
+
+ .. code-block:: bash
+
+ kubectl get svc -n onap | grep 'cds-blueprints-processor-http'
+
+ cds-blueprints-processor-http ClusterIP 10.152.183.211 <none> 8080/TCP 3h19m
+
+ **Set up CDS:**
+
+ First run `Bootstrap` request which will call Bootstrap API of CDS. This loads the CDS default model artifacts into CDS DB.
+ You should get HTTP status 200 as a response.
+
+ You can execute `Get Blueprints` to get all blueprint models in the CDS database. You will see a default
+ model "artifactName": "vFW-CDS" in the response body which was loaded by calling bootstrap.
+
+ Push the PNF CDS blueprint model data dictionary to CDS with `Data Dictionary` request. Request body contains the
+ data from ``dd.json`` of the CBA. This will call the data dictionary endpoint of CDS.
+
+ .. note::
+ For every data dictionary entry CDS API needs to be called seperately. The postman collection contains a loop to
+ go through all entries of :file:`dd.json` and call data dictionary endpoint seperately. To execute this loop,
+ open `Runner` in Postman and run `Data Dictionary` request like it is shown in the picture below.
+
+ |imageDDPostmanRunner|
+
+ Check CDS database for PNF data dictionaries by entering the DB in a terminal. You should see 6 rows as shown below.
+
+ For running CDS in an IDE (accessing mariadb container):
+
+ .. code-block:: sh
+
+ sudo docker exec -it mariadb_container_id mysql -uroot -psdnctl
+ > USE sdnctl;
+ > select name, data_type from RESOURCE_DICTIONARY where updated_by='Aarna service <vmuthukrishnan@aarnanetworks.com>';
+
+ +---------------------+-----------+
+ | name | data_type |
+ +---------------------+-----------+
+ | netconf-password | string |
+ | netconf-server-port | string |
+ | netconf-username | string |
+ | pnf-id | string |
+ | pnf-ipv4-address | string |
+ | stream-count | integer |
+ +---------------------+-----------+
+
+ Replace the container id with your running mariadb container id.
+
+
+ For running CDS in K8s (accessing MariaDB pod):
+
+ Open a terminal and go to ``/Scripts`` directory of your CBA.
+
+ .. code-block:: sh
+
+ ./connect-cds-mariadb-k8s.sh
+
+ select name, data_type from RESOURCE_DICTIONARY where updated_by='Aarna service <vmuthukrishnan@aarnanetworks.com>';
+
+ +---------------------+-----------+
+ | name | data_type |
+ +---------------------+-----------+
+ | netconf-password | string |
+ | netconf-server-port | string |
+ | netconf-username | string |
+ | pnf-id | string |
+ | pnf-ipv4-address | string |
+ | stream-count | integer |
+ +---------------------+-----------+
+
+
+ **Enrichment:**
+
+ .. warning::
+ The provided CBA is already enriched, the following steps anyhow will enrich the CBA again to show the full workflow.
+ For Frankfurt release this causes an issue when the configuration is deployed later on. This happens because some parameters
+ get deleted when enrichment is done a second time. Skip the next steps until Deploy/Save Blueprint if you use
+ Frankfurt release and use the CBA as it is. In future this step should be fixed and executed based on an unenriched CBA.
+
+ Enrich the blueprint through executing the `Enrich Blueprint` request. Take care to provide the CBA file which you
+ downloaded earlier in the request body. After the request got executed save the response body, this will be the
+ enriched CBA file.
+
+ |saveResponseImage|
+
+
+ **Deploy/Save the Blueprint into CDS database**
+
+ Run `Save Blueprint` request to save/deploy the Blueprint into the CDS database. Take care to provide the enriched
+ CBA file in the request body.
+
+ After that you should see the new model "artifactName": "pnf_netconf" by calling `Get Blueprints` request.
+
+ **Config-Assign**
+
+ The assumption is that we are using the same host to run PNF NETCONF simulator as well as CDS. You will need the
+ IP Adress of the Netconf server container which can be found out in terminal with
+ ``docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' netopeer2``. In the provided
+ postman collection 172.17.0.2 is set as default.
+
+ For creating the day-n config we are using the template file ``day-n-pnf-config.template`` in the folder
+ ``Scripts/templates`` of the CBA. ``CONFIG_NAME``, ``PNF_IP_ADDRESS`` and ``STREAM_COUNT`` are replaced with specific values.
+
+ Day-1 configuration:
+
+ Execute the request `Create Config Assign Day-1`. Replace the values in the reqest body if needed.
+
+ You can verify the day-1 NETCONF RPC payload looking into CDS DB. You should see the NETCONF RPC with 5
+ streams (fw_udp_1 TO fw_udp_5). Connect to the DB like mentioned above and run the below statement. You should
+ see the day-1 configuration as an output.
+
+ .. code-block:: sh
+
+ MariaDB [sdnctl]> select * from TEMPLATE_RESOLUTION where resolution_key='day-1' AND artifact_name='netconfrpc';
+
+ <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
+ <edit-config>
+ <target>
+ <running/>
+ </target>
+ <config>
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ </config>
+ </edit-config>
+ </rpc>
+
+
+ **Day-2 configuration:**
+
+ Execute the request `Create Config Assign Day-2`. It will do the same request like in day-1-config just with
+ different values (resolution-key = day-2, stream-count = 10).
+
+ You can verify the day-2 NETCONF RPC payload looking into CDS DB. You should see the NETCONF RPC with 10
+ streams (fw_udp_1 TO fw_udp_10). Connect to the DB like mentioned above and run the below statement. You should
+ see the day-2 configuration as an output.
+
+ .. code-block:: sh
+
+ MariaDB [sdnctl]> select * from TEMPLATE_RESOLUTION where resolution_key='day-2' AND artifact_name='netconfrpc';
+
+ <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
+ <edit-config>
+ <target>
+ <running/>
+ </target>
+ <config>
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_6</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_7</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_8</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_9</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_10</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ </config>
+ </edit-config>
+ </rpc>
+
+ .. note::
+ Until this step CDS did not interact with the PNF simulator or device. We just created the day-1 and day-2
+ configurations and stored it in CDS database
+
+ **Config-Deploy:**
+
+ Now we will make the CDS REST API calls to push the day-1 and day-2 configuration changes to the PNF simulator.
+
+ If you run CDS in Kubernetes open a terminal in `/Scripts` folder and keep it running with ``bash -x ./tail-cds-bp-log.sh``,
+ we can use this to review the config-deploy actions. If you run CDS in an IDE you can have a look into the IDE terminal.
+
+ Executing `Config Assign Day-1 Deploy` request will deploy day-1 configuration. Take care to provide the right PNF
+ IP Adress in the request body.
+
+ Go back to PNF netopeer cli console like mentioned above and verify if you can see 5 streams fw_udp_1 to fw_udp_5 enabled. If the 5 streams
+ appear in the output as follows, the day-1 configuration got successfully deployed and the use case is successfully done.
+
+ .. code-block:: sh
+
+ > get --filter-xpath /sample-plugin:*
+ DATA
+ <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin">
+ <pg-streams>
+ <pg-stream>
+ <id>1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_1</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_2</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_3</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_4</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ <pg-stream>
+ <id>fw_udp_5</id>
+ <is-enabled>true</is-enabled>
+ </pg-stream>
+ </pg-streams>
+ </sample-plugin>
+ >
+
+ Day-2 configuration can be deployed the same way, just use `day-2` as a resolution key in the `Config Assign Depoy`
+ request.
+
+ .. note::
+ Through deployment we did not deploy the PNF, we just modified the PNF. The PNF could also be installed by CDS
+ but this is not targeted in this guide.
+
+
+.. warning::
+ Both CBA file and Postman collection should be integrated into source code of CDS. There is already an approach for that,
+ see https://gerrit.onap.org/r/c/ccsdk/cds/+/112288. Updated Scripts and Postman collection needs to be added to this change.
+
+
+Creators of this guide
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Deutsche Telekom AG
+
+Jakob Krieg (Rocketchat @jakob.Krieg); Eli Halych (Rocketchat @elihalych)
+
+This guide is a derivate from https://wiki.onap.org/display/DW/PNF+Simulator+Day-N+config-assign+and+config-deploy+use+case.
+
+
+.. |saveResponseImage| image:: media/save-response-postman.png
+ :width: 500pt
+
+.. |imageDDPostmanRunner| image:: media/dd-postman-runner.png
+ :width: 500pt
\ No newline at end of file
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0
+.. International License. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Deutsche Telekom AG.
+
+Use Cases
+=========
+
+.. toctree::
+ :caption: Table of Contents
+ :maxdepth: 1
+
+ wordpress-cnf-poc
+ pnf-simulator
\ No newline at end of file
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0
+.. International License. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Deutsche Telekom AG.
+
+Wordpress CNF in CDS (POC)
+==========================
+
+This demo by CableLabs shows an easy to use POC how to use/deploy VNFs in CDS and do resource asignment.
+
+Detailed description will follow as soon as there is an acknowledgement from CableLabs that content can be published.
+
+Goal is to use CDS (ONAP) in a very simple and understandable way. Azure, AWS
+and Kubernetes are used as VIMs trough scripting. Wordpress is used as a VNF.
+
+This demo was tested on Frankfurt.
+
+Presentation of Gerald Karam (2020-09-08)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. raw:: html
+
+ <!-- original size of video is 1920x1080-->
+ <div style="position: relative; max-width: 100%; height: auto;">
+ <iframe width="800" height="450" src="https://www.youtube.com/embed/mgMpI_irp4I" frameborder="0"
+ allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
+ </div>
+
+|
\ No newline at end of file
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2019 IBM.
-Design Time User Guide
-======================
+Design Time Tools Guide
+=======================
Below are the requirements to enable automation for a service within ONAP.
---------
.. toctree::
- :maxdepth: 1
-
- CBA/index
- datadictionary/index
+ :maxdepth: 2
+
+ ../cba/index
+ ../resourcedefinition/index
resourceassignment
.. Copyright (C) 2019 IBM.
-User Guide
-==========
+Installation Guide
+==================
Installation
------------
.. code-block:: bash
:linenos:
-
+
$ kubectl get all --selector=release=cds
NAME READY STATUS RESTARTS AGE
pod/cds-blueprints-processor-54f758d69f-p98c2 0/1 Running 1 2m
pod/cds-cds-6bd674dc77-4gtdf 1/1 Running 0 2m
pod/cds-cds-db-0 1/1 Running 0 2m
pod/cds-controller-blueprints-545bbf98cf-zwjfc 1/1 Running 0 2m
+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/blueprints-processor ClusterIP 10.43.139.9 <none> 8080/TCP,9111/TCP 2m
service/cds NodePort 10.43.254.69 <none> 3000:30397/TCP 2m
service/cds-db ClusterIP None <none> 3306/TCP 2m
service/controller-blueprints ClusterIP 10.43.207.152 <none> 8080/TCP 2m
+
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/cds-blueprints-processor 1 1 1 0 2m
deployment.apps/cds-cds 1 1 1 1 2m
deployment.apps/cds-controller-blueprints 1 1 1 1 2m
+
NAME DESIRED CURRENT READY AGE
replicaset.apps/cds-blueprints-processor-54f758d69f 1 1 0 2m
replicaset.apps/cds-cds-6bd674dc77 1 1 1 2m
replicaset.apps/cds-controller-blueprints-545bbf98cf 1 1 1 2m
+
NAME DESIRED CURRENT AGE
statefulset.apps/cds-cds-db 1 1 2m
-
-
-
+
+
+
Running CDS UI:
---------------
~~~~~~~
Install Node.js and angularCLI. Refer https://angular.io/guide/quickstart
npm install in the directory cds/cds-ui/client
-npm run build - to build UI module
-
+npm run build - to build UI module
Loopback Server:
~~~~~~~~~~~~~~~~
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2019 IBM.
-Resource Assignment
--------------------
+Resource Assignment
+===================
.. toctree::
:maxdepth: 1
-
-
+
+
Component executor:
-===================
+-------------------
Workflow:
-=========
+~~~~~~~~~
A workflow defines an overall action to be taken for the service; it can be composed of a set of sub-actions to execute. Currently, workflows are backed by Directed Graph engine.
A CBA can have as many workflow as needed.
Template:
-=========
+~~~~~~~~~
A template is an artifact.
A template can represent anything, such as device config, payload to interact with 3rd party systems, resource-accumulator template, etc...
Mapping:
-========
+~~~~~~~~
Defines the contract of each resource to be resolved. Each placeholder in the template must have a corresponding mapping definition.
A mapping is comprised of:
- dictionary-source
Dependencies:
-=============
+~~~~~~~~~~~~~
This allows to make sure given resources get resolved prior the resolution of the resources defining the dependency.
The dictionary fields reference to a specific data dictionary.
+
Resource accumulator:
-=====================
+---------------------
In order to resolve HEAT environment variables, resource accumulator templates are being in used for Dublin.
Have the blueprint processor running locally is to use the IDE to run the code, while having the database running in a container.
This way, code changes can be conveniently tested and debugged.
-
Check out the code
~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
- mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
+ mvn clean install -Pq -Dadditionalparam=-Xdoclint:none
Spin up a Docker container with the database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tabs::
- .. group-tab:: Latest
-
- .. code-block:: bash
-
- cd ms/blueprintsprocessor/application/src/main/dc
-
- .. group-tab:: Frankfurt
+ .. group-tab:: Frankfurt - Latest
.. code-block:: bash
cd ms/blueprintsprocessor/application/src/main/dc
- .. group-tab:: El Alto
-
- .. code-block:: bash
-
- ms/blueprintsprocessor/distribution/src/main/dc
-
- .. group-tab:: Dublin
+ .. group-tab:: El Alto - Dublin
.. code-block:: bash
docker start <id of mariadb container>
-
Set permissions on the local file system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|imageReimportMaven|
-
**Override some application properties:**
After the project is compiled, a Run Configuration profile overriding some application properties
.. tabs::
- .. group-tab:: Latest
-
- Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class:
-
- ``ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt``.
-
- Right-click inside it, at any point, to load the context menu and select create
- BlueprintProcessorApplication configuration from context:
-
- |imageCreateRunConfigkt|
-
- **The following window will open:**
-
- |imageRunConfigKt|
-
- **Add the following in the field `VM Options`:**
-
- .. code-block:: bash
- :caption: **Custom values for properties**
-
- -Dspring.profiles.active=dev
-
- You can override any value from **application-dev.properties** file here. Use the following pattern:
-
- .. code-block:: java
-
- -D<application-dev.properties key>=<application-dev.properties value>
-
- .. group-tab:: Frankfurt
+ .. group-tab:: Frankfurt - Latest
Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class:
-Dserver.port=55555
- **Browse Working Directory to your application path** ``.../cds/ms/blueprintsprocessor/application``
+ **Browse Working Directory to your application path** ``.../cds/ms/blueprintsprocessor/application``
**if path is not already specified correctly.**
**Add/replace the following in Blueprint's application-dev.properties file:**
.. tabs::
- .. group-tab:: Latest
+ .. group-tab:: Frankfurt - Latest
* **Step #1** - Make sure your installation of Visual Studio Code is up to date. This guide was writen using version 1.48
* **Step #2** - Install `Kotlin extension from the Visual Studio Code Marketplace <https://marketplace.visualstudio.com/items?itemName=fwcd.kotlin>`_
.. code-block:: json
{
- "type": "kotlin",
- "request": "launch",
- "name": "Blueprint Processor",
- "projectRoot": "${workspaceFolder}/ms/blueprintsprocessor/application",
- "mainClass": "-Dspring.profiles.active=dev org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt"
+ "type": "kotlin",
+ "request": "launch",
+ "name": "Blueprint Processor",
+ "projectRoot": "${workspaceFolder}/ms/blueprintsprocessor/application",
+ "mainClass": "-Dspring.profiles.active=dev org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt"
}
.. warning:: The `projectRoot` path assumes that you created your Workspace in the main CDS repository folder. If not - please change the path accordingly
Testing the application
-~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~
There are two main features of the Blueprints Processor that can be of interest of a developer:
blueprint publish and blueprint process.
A detailed description of the usage of different APIs of CDS will follow.
+
Possible Fixes
-~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~
Imported packages or annotiations are not found, Run Config not available?
*****************************************************************************
3. Maven reimport in IDE
Compilation error?
-********************
+*******************
-* Change Java Version to 11 or 8
+* Change Java Version to 11
.. image alignment inside tabs doesn't work
.. |imageRunConfigJava| image:: media/run_config_java.png
- :scale: 75 %
+ :width: 500pt
:align: middle
.. |imageRunConfigKt| image:: media/run_config_kt.png
- :scale: 75 %
+ :width: 500pt
:align: middle
.. |imageCreateRunConfigJava| image:: media/create_run_config_java.png
- :scale: 75 %
+ :width: 500pt
:align: middle
.. |imageCreateRunConfigKt| image:: media/create_run_config_kt.png
- :scale: 75 %
+ :width: 500pt
:align: middle
.. |imageImportProject| image:: media/import_project.png
- :scale: 75 %
+ :width: 300pt
:align: middle
.. |imageReimportMaven| image:: media/reimport_maven.png
- :scale: 75 %
- :align: middle
-
-.. |imageRunDebug| image:: media/run_debug.png
- :scale: 75 %
+ :width: 400pt
:align: middle
.. |imageRunDebug| image:: media/run_debug.png
+ :width: 500pt
:align: middle
- :scale: 75 %
.. |imageBuildLogs| image:: media/build_logs.png
+ :width: 500pt
:align: middle
- :scale: 75 %
.. |imageLogsVSC| image:: media/vsc_logs.png
+ :width: 500pt
:align: middle
- :scale: 75 %
\ No newline at end of file
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
- <artifactId>application</artifactId>
+ <artifactId>blueprintsprocessor-application</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Application</name>
- <description>Blueprints Processor Application</description>
+ <name>MS Blueprints Processor Application</name>
<properties>
<assembly.id>maven</assembly.id>
<name.space>org.onap.ccsdk.cds</name.space>
<serviceArtifactName>blueprintsprocessor</serviceArtifactName>
<image.name>onap/ccsdk-blueprintsprocessor</image.name>
- <docker.push.phase>deploy</docker.push.phase>
- <docker.verbose>true</docker.verbose>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
</properties>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-core</artifactId>
<exclusions>
<exclusion>
<artifactId>error-catalog-services</artifactId>
</dependency>
- <!-- North Bound -->
+ <!-- North Bound - Modules -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>designer-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>resource-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>selfservice-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>configs-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api-common</artifactId>
</dependency>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>k8s-profile-upload</artifactId>
</dependency>
+
+ <!-- Test Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
+
<!-- BEGIN UAT -->
<dependency>
<groupId>org.skyscreamer</groupId>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
-
</dependencies>
<build>
</resource>
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin.version}</version>
+ <configuration>
+ <!-- Sets the VM argument line used when unit tests are run. -->
+ <argLine>-Xmx1024m -XX:MaxPermSize=256m ${surefireArgLine}</argLine>
+ <!-- Excludes integration tests when unit tests are run. -->
+ <excludes>
+ <exclude>**/IT*.java</exclude>
+ </excludes>
+ <reuseForks>false</reuseForks>
+ <forkCount>1</forkCount>
+ </configuration>
+ </plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.26.1</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
- <verbose>true</verbose>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
+ <id>build-push-images</id>
<phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
-FROM alpine:latest AS extractor
+FROM onap/ccsdk-alpine-j11-image:1.0.1
+
+USER root
+# add entrypoint
+COPY startService.sh /opt/app/onap/blueprints-processor/startService.sh
+# add application
COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
+
RUN tar -xzf /source.tar.gz -C /tmp \
&& cp -rf /tmp/@project.build.finalName@/opt / \
&& rm -rf /source.tar.gz \
- && rm -rf /tmp/@project.build.finalName@
-
-FROM omahoco1/alpine-java-python
+ && rm -rf /tmp/@project.build.finalName@ \
+ && touch /velocity.log \
+ && chown onap:onap /velocity.log \
+ && chmod 755 /velocity.log \
+ && mkdir -p /opt/app/onap/blueprints/deploy \
+ && chown onap:onap /opt -R \
+ && chmod 755 /opt/app/onap/blueprints-processor/startService.sh
-# add entrypoint
-COPY startService.sh /startService.sh
-RUN addgroup -S -g 1000 onap && adduser -u 1000 -S onap -G onap
-RUN chown onap:onap /startService.sh
-RUN touch /velocity.log && chmod 777 /velocity.log
-RUN chown onap:onap /velocity.log
-RUN chmod 777 /startService.sh && dos2unix /startService.sh
-
-# add application
-COPY --from=extractor /opt /opt
-RUN mkdir -p /opt/app/onap/blueprints/deploy
-RUN chown onap:onap /opt -R
USER onap
-
-ENTRYPOINT [ "/startService.sh" ]
+ENTRYPOINT [ "/opt/app/onap/blueprints-processor/startService.sh" ]
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.controllerblueprints", "org.onap.ccsdk.cds.blueprintsprocessor",
- "org.onap.ccsdk.cds.error.catalog"],
+ basePackages = [
+ "org.onap.ccsdk.cds.controllerblueprints", "org.onap.ccsdk.cds.blueprintsprocessor",
+ "org.onap.ccsdk.cds.error.catalog"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
@SpringBootApplication
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class, HazelcastAutoConfiguration::class])
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog",
- "org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"]
+ basePackages = [
+ "org.onap.ccsdk.cds.error.catalog",
+ "org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"
+ ]
)
open class BlueprintProcessorApplication
@RestControllerAdvice("org.onap.ccsdk.cds")
open class BlueprintProcessorExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
- ErrorCatalogExceptionHandler(errorCatalogService)
+ ErrorCatalogExceptionHandler(errorCatalogService)
*/
@Component
open class BluePrintCustomIndicator(private val bluePrintProcessorHealthCheck: BluePrintProcessorHealthCheck) :
- AbstractHealthIndicator() {
+ AbstractHealthIndicator() {
private var logger = LoggerFactory.getLogger(BluePrintCustomIndicator::class.java)
}
companion object {
+
private const val INDENT = " "
private val log = LoggerFactory.getLogger(MockInvocationLogger::class.java)
}
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
internal class PathDeserializer : StdDeserializer<String>(String::class.java) {
+
override fun deserialize(jp: JsonParser, ctxt: DeserializationContext?): String {
val path = jp.codec.readValue(jp, Any::class.java)
return flatJoin(path)
import org.mockito.ArgumentMatcher
class RequiredMapEntriesMatcher<K, V>(private val requiredEntries: Map<K, V>) : ArgumentMatcher<Map<K, V>> {
+
override fun matches(argument: Map<K, V>?): Boolean {
val missingEntries = Maps.difference(requiredEntries, argument).entriesOnlyOnLeft()
return missingEntries.isEmpty()
)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
-data class ResponseDefinition(val status: Int = 200, val body: JsonNode? = null, val headers: Map<String, String> = mapOf("Content-Type" to "application/json")) {
+data class ResponseDefinition(
+ val status: Int = 200,
+ val body: JsonNode? = null,
+ val headers: Map<String, String> = mapOf("Content-Type" to "application/json")
+) {
companion object {
+
val DEFAULT_RESPONSES = listOf(ResponseDefinition())
}
}
responses: List<ResponseDefinition>? = null,
val times: String = ">= 1"
) {
+
val responses: List<ResponseDefinition> = resolveOneOrMany(response, responses, ResponseDefinition.DEFAULT_RESPONSES)
companion object {
+
fun <T> resolveOneOrMany(one: T?, many: List<T>?, defaultMany: List<T>): List<T> = when {
many != null -> many
one != null -> listOf(one)
}
companion object {
+
fun load(mapper: ObjectMapper, spec: String): UatDefinition =
- mapper.convertValue(Yaml().load(spec), UatDefinition::class.java)
+ mapper.convertValue(Yaml().load(spec), UatDefinition::class.java)
}
}
) {
companion object {
+
private const val NOOP_PASSWORD_PREFIX = "{noop}"
private const val PROPERTY_IN_UAT = "IN_UAT"
private val TIMES_SPEC_REGEX = "([<>]=?)?\\s*(\\d+)".toRegex()
fun execute(uat: UatDefinition, cbaBytes: ByteArray): UatDefinition {
val defaultHeaders = listOf(BasicHeader(HttpHeaders.AUTHORIZATION, clientAuthToken()))
val httpClient = HttpClientBuilder.create()
- .setDefaultHeaders(defaultHeaders)
- .build()
+ .setDefaultHeaders(defaultHeaders)
+ .build()
// Only if externalServices are defined
val mockInterceptor = MockPreInterceptor()
// Always defined and used, whatever the case
markUatBegin()
// Configure mocked external services and save their expectations for further validation
val expectationsPerClient = uat.externalServices.associateBy(
- { service ->
- createRestClientMock(service.expectations).also { restClient ->
- // side-effect: register restClient to override real instance
- mockInterceptor.registerMock(service.selector, restClient)
- }
- },
- { service -> service.expectations }
+ { service ->
+ createRestClientMock(service.expectations).also { restClient ->
+ // side-effect: register restClient to override real instance
+ mockInterceptor.registerMock(service.selector, restClient)
+ }
+ },
+ { service -> service.expectations }
)
val newProcesses = httpClient.use { client ->
log.info("Executing process '${process.name}'")
val responseNormalizer = JsonNormalizer.getNormalizer(mapper, process.responseNormalizerSpec)
val actualResponse = processBlueprint(
- client, process.request,
- process.expectedResponse, responseNormalizer
+ client, process.request,
+ process.expectedResponse, responseNormalizer
)
ProcessDefinition(
- process.name,
- process.request,
- actualResponse,
- process.responseNormalizerSpec
+ process.name,
+ process.request,
+ actualResponse,
+ process.responseNormalizerSpec
)
}
}
expectations.forEach { expectation ->
val request = expectation.request
verify(mockClient, evalVerificationMode(expectation.times)).exchangeResource(
- eq(request.method),
- eq(request.path),
- argThat { assertJsonEquals(request.body, this) },
- argThat(RequiredMapEntriesMatcher(request.headers))
+ eq(request.method),
+ eq(request.path),
+ argThat { assertJsonEquals(request.body, this) },
+ argThat(RequiredMapEntriesMatcher(request.headers))
)
}
// Don't mind the invocations to the overloaded exchangeResource(String, String, String)
}
val newExternalServices = spyInterceptor.getSpies()
- .map(SpyService::asServiceDefinition)
+ .map(SpyService::asServiceDefinition)
return UatDefinition(newProcesses, newExternalServices)
} finally {
}
private fun createRestClientMock(restExpectations: List<ExpectationDefinition>):
- BlueprintWebClientService {
- val restClient = mock<BlueprintWebClientService>(
+ BlueprintWebClientService {
+ val restClient = mock<BlueprintWebClientService>(
defaultAnswer = Answers.RETURNS_SMART_NULLS,
// our custom verboseLogging handler
invocationListeners = arrayOf(mockLoggingListener)
- )
+ )
- // Delegates to overloaded exchangeResource(String, String, String, Map<String, String>)
- whenever(restClient.exchangeResource(any(), any(), any()))
+ // Delegates to overloaded exchangeResource(String, String, String, Map<String, String>)
+ whenever(restClient.exchangeResource(any(), any(), any()))
.thenAnswer { invocation ->
val method = invocation.arguments[0] as String
val path = invocation.arguments[1] as String
val request = invocation.arguments[2] as String
restClient.exchangeResource(method, path, request, emptyMap())
}
- for (expectation in restExpectations) {
- var stubbing = whenever(
+ for (expectation in restExpectations) {
+ var stubbing = whenever(
restClient.exchangeResource(
- eq(expectation.request.method),
- eq(expectation.request.path),
- any(),
- any()
+ eq(expectation.request.method),
+ eq(expectation.request.path),
+ any(),
+ any()
)
- )
- for (response in expectation.responses) {
- stubbing = stubbing.thenReturn(WebClientResponse(response.status, response.body.toString()))
+ )
+ for (response in expectation.responses) {
+ stubbing = stubbing.thenReturn(WebClientResponse(response.status, response.body.toString()))
+ }
}
+ return restClient
}
- return restClient
- }
@Throws(AssertionError::class)
private fun uploadBlueprint(client: HttpClient, cbaBytes: ByteArray) {
val multipartEntity = MultipartEntityBuilder.create()
- .setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
- .addBinaryBody("file", cbaBytes, ContentType.DEFAULT_BINARY, "cba.zip")
- .build()
+ .setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
+ .addBinaryBody("file", cbaBytes, ContentType.DEFAULT_BINARY, "cba.zip")
+ .build()
val request = HttpPost("$baseUrl/api/v1/blueprint-model/publish").apply {
entity = multipartEntity
}
private fun evalVerificationMode(times: String): VerificationMode {
val matchResult = TIMES_SPEC_REGEX.matchEntire(times) ?: throw InvalidUatDefinition(
- "Time specification '$times' does not follow expected format $TIMES_SPEC_REGEX")
+ "Time specification '$times' does not follow expected format $TIMES_SPEC_REGEX"
+ )
val counter = matchResult.groups[2]!!.value.toInt()
return when (matchResult.groups[1]?.value) {
">=" -> atLeast(counter)
}
private fun localServerPort(): Int =
- (environment.getProperty("local.server.port")
- ?: environment.getRequiredProperty("blueprint.httpPort")).toInt()
+ (
+ environment.getProperty("local.server.port")
+ ?: environment.getRequiredProperty("blueprint.httpPort")
+ ).toInt()
private fun clientAuthToken(): String {
val username = environment.getRequiredProperty("security.user.name")
val password = environment.getRequiredProperty("security.user.password")
val plainPassword = when {
password.startsWith(NOOP_PASSWORD_PREFIX) -> password.substring(
- NOOP_PASSWORD_PREFIX.length)
+ NOOP_PASSWORD_PREFIX.length
+ )
else -> username
}
return "Basic " + Base64Utils.encodeToString("$username:$plainPassword".toByteArray())
}
private class MockPreInterceptor : BluePrintRestLibPropertyService.PreInterceptor {
+
private val mocks = ConcurrentHashMap<String, BlueprintWebClientService>()
override fun getInstance(jsonNode: JsonNode): BlueprintWebClientService? {
}
override fun getInstance(selector: String): BlueprintWebClientService? =
- mocks[selector]
+ mocks[selector]
fun registerMock(selector: String, client: BlueprintWebClientService) {
mocks[selector] = client
}
fun getSpies(): List<SpyService> =
- spies.values.toList()
+ spies.values.toList()
}
private class SpyService(
val selector: String,
private val realService: BlueprintWebClientService
) :
- BlueprintWebClientService by realService {
+ BlueprintWebClientService by realService {
private val expectations: MutableList<ExpectationDefinition> = mutableListOf()
override fun exchangeResource(methodType: String, path: String, request: String): WebClientResponse<String> =
- exchangeResource(methodType, path, request,
- DEFAULT_HEADERS
- )
+ exchangeResource(
+ methodType, path, request,
+ DEFAULT_HEADERS
+ )
override fun exchangeResource(
methodType: String,
headers: Map<String, String>
): WebClientResponse<String> {
val requestDefinition =
- RequestDefinition(methodType, path, headers, toJson(request))
+ RequestDefinition(methodType, path, headers, toJson(request))
val realAnswer = realService.exchangeResource(methodType, path, request, headers)
val responseBody = when {
// TODO: confirm if we need to normalize the response here
else -> null
}
val responseDefinition =
- ResponseDefinition(realAnswer.status, responseBody)
+ ResponseDefinition(realAnswer.status, responseBody)
expectations.add(
- ExpectationDefinition(
- requestDefinition,
- responseDefinition
- )
+ ExpectationDefinition(
+ requestDefinition,
+ responseDefinition
+ )
)
return realAnswer
}
}
fun asServiceDefinition() =
- ServiceDefinition(selector, expectations)
+ ServiceDefinition(selector, expectations)
private fun toJson(str: String): JsonNode? {
return when {
}
companion object {
+
private val DEFAULT_HEADERS = mapOf(
- HttpHeaders.CONTENT_TYPE to MediaType.APPLICATION_JSON_VALUE,
- HttpHeaders.ACCEPT to MediaType.APPLICATION_JSON_VALUE
+ HttpHeaders.CONTENT_TYPE to MediaType.APPLICATION_JSON_VALUE,
+ HttpHeaders.ACCEPT to MediaType.APPLICATION_JSON_VALUE
)
}
}
val uat = UatDefinition.load(mapper, uatSpec)
val cbaBytes = tempFile.readBytes()
val updatedUat = uatExecutor.execute(uat, cbaBytes)
- return@runBlocking updatedUat.dump(mapper,
+ return@runBlocking updatedUat.dump(
+ mapper,
FIELDS_TO_EXCLUDE
)
} catch (t: Throwable) {
}
companion object {
+
// Fields that can be safely ignored from BPP response, and can be omitted on the UAT specification.
private val FIELDS_TO_EXCLUDE = listOf("timestamp")
}
}
companion object {
+
const val UAT_BLUEPRINTS_BASE_DIR = "../../../components/model-catalog/blueprint-model/uat-blueprints"
}
}
@Parameterized.Parameters(name = "{index} {0}")
@JvmStatic
fun scanUatEmpoweredBlueprints(): List<Array<Any>> {
- return (File(UAT_BLUEPRINTS_BASE_DIR)
- .listFiles { file -> file.isDirectory && File(file, UAT_SPECIFICATION_FILE).isFile }
- ?: throw RuntimeException("Failed to scan $UAT_BLUEPRINTS_BASE_DIR"))
+ return (
+ File(UAT_BLUEPRINTS_BASE_DIR)
+ .listFiles { file -> file.isDirectory && File(file, UAT_SPECIFICATION_FILE).isFile }
+ ?: throw RuntimeException("Failed to scan $UAT_BLUEPRINTS_BASE_DIR")
+ )
.map { file ->
arrayOf(
file.nameWithoutExtension,
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
class UatServicesTest : BaseUatTest() {
companion object {
+
private const val BLUEPRINT_NAME = "pnf_config"
private val BLUEPRINT_BASE_DIR = Paths.get(UAT_BLUEPRINTS_BASE_DIR, BLUEPRINT_NAME)
private val UAT_PATH = BLUEPRINT_BASE_DIR.resolve(UAT_SPECIFICATION_FILE)
for (response in expectation.responses) {
val responseDefinitionBuilder: ResponseDefinitionBuilder = aResponse()
- .withStatus(response.status)
+ .withStatus(response.status)
if (response.body != null) {
responseDefinitionBuilder.withBody(mapper.writeValueAsBytes(response.body))
- .withHeaders(HttpHeaders(
- response.headers.entries.map { e -> HttpHeader(e.key, e.value) }))
+ .withHeaders(
+ HttpHeaders(
+ response.headers.entries.map { e -> HttpHeader(e.key, e.value) }
+ )
+ )
}
// TODO: MockServer verification for multiple responses should be done using Wiremock scenarios
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [ErrorCatalogTestConfiguration::class]
+ classes = [ErrorCatalogTestConfiguration::class]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class ErrorCatalogServiceTest {
+
@Autowired
lateinit var errorCatalogService: ErrorCatalogService
@BeforeTest
fun setup() {
errorType = ErrorCatalogCodes.GENERIC_FAILURE
- errorCatalogHttp = ErrorCatalog(errorType, domain, 500,
- "Contact CDS administrator team.", "Internal error in Blueprint Processor run time.")
- errorCatalogGrpc = ErrorCatalog(errorType, domain, 2,
- "Contact CDS administrator team.", "Internal error in Blueprint Processor run time.")
+ errorCatalogHttp = ErrorCatalog(
+ errorType, domain, 500,
+ "Contact CDS administrator team.", "Internal error in Blueprint Processor run time."
+ )
+ errorCatalogGrpc = ErrorCatalog(
+ errorType, domain, 2,
+ "Contact CDS administrator team.", "Internal error in Blueprint Processor run time."
+ )
- errorPayloadHttp = ErrorPayload(500, ErrorCatalogCodes.GENERIC_FAILURE,
- "Cause: Internal error in Blueprint Processor run time. \n Action : Contact CDS administrator team.",
- errorMessage = ErrorMessage("org.onap.ccsdk.cds.blueprintsprocessor",
- "Internal error in Blueprint Processor run time.", ""))
- errorPayloadGrpc = ErrorPayload(2, ErrorCatalogCodes.GENERIC_FAILURE,
- "Cause: Internal error in Blueprint Processor run time. \n Action : Contact CDS administrator team.",
- errorMessage = ErrorMessage("org.onap.ccsdk.cds.blueprintsprocessor",
- "Internal error in Blueprint Processor run time.", ""))
+ errorPayloadHttp = ErrorPayload(
+ 500, ErrorCatalogCodes.GENERIC_FAILURE,
+ "Cause: Internal error in Blueprint Processor run time. \n Action : Contact CDS administrator team.",
+ errorMessage = ErrorMessage(
+ "org.onap.ccsdk.cds.blueprintsprocessor",
+ "Internal error in Blueprint Processor run time.", ""
+ )
+ )
+ errorPayloadGrpc = ErrorPayload(
+ 2, ErrorCatalogCodes.GENERIC_FAILURE,
+ "Cause: Internal error in Blueprint Processor run time. \n Action : Contact CDS administrator team.",
+ errorMessage = ErrorMessage(
+ "org.onap.ccsdk.cds.blueprintsprocessor",
+ "Internal error in Blueprint Processor run time.", ""
+ )
+ )
}
@Test
fun errorPayloadHttp() {
- val errorPayload = errorCatalogService.errorPayload(httpProcessorException(errorType, domain,
- "Internal error in Blueprint Processor run time."))
+ val errorPayload = errorCatalogService.errorPayload(
+ httpProcessorException(
+ errorType, domain,
+ "Internal error in Blueprint Processor run time."
+ )
+ )
assertTrue { errorPayload.isEqualTo(errorPayloadHttp) }
}
@Test
fun errorPayloadGrpc() {
- val errorPayload = errorCatalogService.errorPayload(grpcProcessorException(errorType, domain,
- "Internal error in Blueprint Processor run time."))
+ val errorPayload = errorCatalogService.errorPayload(
+ grpcProcessorException(
+ errorType, domain,
+ "Internal error in Blueprint Processor run time."
+ )
+ )
assertTrue { errorPayload.isEqualTo(errorPayloadGrpc) }
}
@Test
fun getErrorCatalogHttp() {
- val errorCatalog = errorCatalogService.getErrorCatalog(httpProcessorException(errorType, domain,
- "Internal error in Blueprint Processor run time."))
+ val errorCatalog = errorCatalogService.getErrorCatalog(
+ httpProcessorException(
+ errorType, domain,
+ "Internal error in Blueprint Processor run time."
+ )
+ )
assertTrue { errorCatalog == errorCatalogHttp }
}
@Test
fun getErrorCatalogGrpc() {
- val errorCatalog = errorCatalogService.getErrorCatalog(grpcProcessorException(errorType, domain,
- "Internal error in Blueprint Processor run time."))
+ val errorCatalog = errorCatalogService.getErrorCatalog(
+ grpcProcessorException(
+ errorType, domain,
+ "Internal error in Blueprint Processor run time."
+ )
+ )
assertTrue { errorCatalog == errorCatalogGrpc }
}
}
import org.onap.ccsdk.cds.blueprintsprocessor.uat.logging.LogColor.MDC_COLOR_KEY
class SmartColorDiscriminator : AbstractDiscriminator<ILoggingEvent>() {
+
var defaultValue: String = "white"
override fun getKey(): String {
import javax.annotation.PreDestroy
class ExtendedTemporaryFolder {
+
private val tempFolder = createTempDir("uat")
@PreDestroy
* Delete all files under the root temporary folder recursively. The folders are preserved.
*/
fun deleteAllFiles() {
- Files.walkFileTree(tempFolder.toPath(), object : SimpleFileVisitor<Path>() {
- @Throws(IOException::class)
- override fun visitFile(file: Path?, attrs: BasicFileAttributes?): FileVisitResult {
- file?.toFile()?.delete()
- return FileVisitResult.CONTINUE
+ Files.walkFileTree(
+ tempFolder.toPath(),
+ object : SimpleFileVisitor<Path>() {
+ @Throws(IOException::class)
+ override fun visitFile(file: Path?, attrs: BasicFileAttributes?): FileVisitResult {
+ file?.toFile()?.delete()
+ return FileVisitResult.CONTINUE
+ }
}
- })
+ )
}
}
}
companion object {
+
private val log = LoggerFactory.getLogger("uat.WireMock")
}
}
class TestSecuritySettings {
companion object {
+
private const val authUsername = "walter.white"
private const val authPassword = "Heisenberg"
}
class ServerContextInitializer : ApplicationContextInitializer<ConfigurableApplicationContext> {
+
override fun initialize(context: ConfigurableApplicationContext) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(
context,
</sift>
</appender>
- <logger name="org.springframework.web.HttpLogging" level="trace"/>
- <logger name="org.springframework.web.reactive.function.client.ExchangeFunctions" level="trace"/>
+ <logger name="org.springframework.web.HttpLogging" level="debug"/>
+ <logger name="org.springframework.web.reactive.function.client.ExchangeFunctions" level="debug"/>
<!-- Helpful to optimize Spring Context caching to speed-up tests
and prevent resorting to @DirtiesContext as much as possible -->
<!-- Please refer to https://thoughts-on-java.org/hibernate-logging-guide/
for a lengthy discussion on good Hibernate logging practices -->
<logger name="org.hibernate.SQL" level="debug"/>
- <logger name="org.hibernate.type.descriptor.sql" level="trace"/>
+ <logger name="org.hibernate.type.descriptor.sql" level="debug"/>
<logger name="org.apache.http" level="debug"/>
<logger name="org.apache.http.wire" level="error"/>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>ansible-awx-executor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - Ansible AWX Executor</name>
+ <name>MS Blueprints Processor Functions - Ansible AWX Executor</name>
<description>Blueprints Processor Function - Ansible Executor</description>
<dependencies>
<artifactId>jython-standalone</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>rest-lib</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
var checkDelay: Long = 15_000
companion object {
+
private val log = LoggerFactory.getLogger(ComponentRemoteAnsibleExecutor::class.java)
// input fields names accepted by this executor
// provide more information via the response, like the ignored_fields, or variables_needed_to_start,
// or resources_needed_to_start, in order to help user pinpoint the problems with the request.
val message = "Execution of job template $job_template_name could not be started for requestId $processId." +
- " (Response: ${response.body}) "
+ " (Response: ${response.body}) "
log.error(message)
setNodeOutputErrors(ATTRIBUTE_EXEC_CMD_STATUS_ERROR, message)
}
private val webClientService = mockk<BlueprintWebClientService>()
companion object {
+
private const val jtId = 9
private const val jobId = 223
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>cli-executor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - CLI Executor</name>
+ <name>MS Blueprints Processor Functions - CLI Executor</name>
<description>Blueprints Processor Function - CLI Executor</description>
<dependencies>
<artifactId>resource-resolution</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>ssh-lib</artifactId>
</dependency>
</dependencies>
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [CliExecutorConfiguration::class,
+ classes = [
+ CliExecutorConfiguration::class,
ExecutionServiceConfiguration::class,
BluePrintSshLibConfiguration::class, BluePrintScriptsServiceImpl::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, BluePrintDependencyService::class]
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, BluePrintDependencyService::class
+ ]
)
@DirtiesContext
@TestPropertySource(properties = [], locations = ["classpath:application-test.properties"])
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>config-snapshots</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - Config Snapshots</name>
+ <name>MS Blueprints Processor Functions - Config Snapshots</name>
<description>Blueprints Processor Function - Config Snapshots</description>
<dependencies>
AbstractComponentFunction() {
companion object {
+
private val log = LoggerFactory.getLogger(ComponentConfigSnapshotsExecutor::class.java)
// input fields names accepted by this executor
setNodeOutputProperties(OUTPUT_STATUS_SUCCESS, cfgSnapshotValue)
} catch (er: NoSuchElementException) {
val message = "No Resource config snapshot identified by resourceId={$resourceId}, " +
- "resourceType={$resourceType} does not exists"
+ "resourceType={$resourceType} does not exists"
setNodeOutputErrors(OUTPUT_STATUS_ERROR, message)
}
}
val output = StringBuilder()
output.append(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
- "<diff>"
+ "<diff>"
)
val diffIterator = differences.getDifferences().iterator()
while (diffIterator.hasNext()) {
var createdDate = Date()
companion object {
+
private const val serialVersionUID = 1L
}
?.let {
log.info(
"Overwriting configuration snapshot entry for resourceId=($resId), " +
- "resourceType=($resType), status=($status)"
+ "resourceType=($resType), status=($status)"
)
resourceConfigSnapshotRepository.deleteByResourceIdAndResourceTypeAndStatus(resId, resType, status)
}
storedSnapshot = resourceConfigSnapshotRepository.saveAndFlush(resourceConfigSnapshotEntry)
log.info(
"Stored configuration snapshot for resourceId=($resId), " +
- "resourceType=($resType), status=($status), " +
- "dated=(${storedSnapshot.createdDate})"
+ "resourceType=($resType), status=($status), " +
+ "dated=(${storedSnapshot.createdDate})"
)
} catch (ex: DataIntegrityViolationException) {
throw BluePrintException("Failed to store configuration snapshot entry.", ex)
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>k8s-profile-upload</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - K8s Profile Upload</name>
+ <name>MS Blueprints Processor Functions - K8s Profile Upload</name>
<description>Blueprints Processor Function - K8s Profile Upload</description>
<dependencies>
<artifactId>resource-resolution</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>ssh-lib</artifactId>
</dependency>
</dependencies>
package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.profile.upload
-import org.springframework.http.HttpMethod
import com.fasterxml.jackson.databind.ObjectMapper
import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import java.nio.file.Path
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.slf4j.LoggerFactory
+import org.springframework.http.HttpMethod
+import java.nio.file.Path
class K8sPluginApi(
val username: String,
val definition: String?,
val definitionVersion: String?
) {
+
private val service: K8sUploadFileRestClientService // BasicAuthRestClientService
private val log = LoggerFactory.getLogger(K8sPluginApi::class.java)!!
import com.fasterxml.jackson.annotation.JsonProperty
class K8sProfile {
+
@get:JsonProperty("rb-name")
var rbName: String? = null
+
@get:JsonProperty("rb-version")
var rbVersion: String? = null
+
@get:JsonProperty("profile-name")
var profileName: String? = null
+
@get:JsonProperty("namespace")
var namespace: String? = "default"
package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.profile.upload
import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import org.apache.commons.io.FileUtils
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
-import kotlin.collections.ArrayList
@Component("component-k8s-profile-upload")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
AbstractComponentFunction() {
companion object {
+
const val INPUT_K8S_PROFILE_NAME = "k8s-rb-profile-name"
const val INPUT_K8S_DEFINITION_NAME = "k8s-rb-definition-name"
const val INPUT_K8S_DEFINITION_VERSION = "k8s-rb-definition-version"
const val INPUT_K8S_PROFILE_NAMESPACE = "k8s-rb-profile-namespace"
const val INPUT_K8S_PROFILE_SOURCE = "k8s-rb-profile-source"
const val INPUT_RESOURCE_ASSIGNMENT_MAP = "resource-assignment-map"
+ const val INPUT_ARTIFACT_PREFIX_NAMES = "artifact-prefix-names"
const val OUTPUT_STATUSES = "statuses"
const val OUTPUT_SKIPPED = "skipped"
INPUT_K8S_DEFINITION_NAME,
INPUT_K8S_DEFINITION_VERSION,
INPUT_K8S_PROFILE_NAMESPACE,
- INPUT_K8S_PROFILE_SOURCE
+ INPUT_K8S_PROFILE_SOURCE,
+ INPUT_ARTIFACT_PREFIX_NAMES
)
var outputPrefixStatuses = mutableMapOf<String, String>()
var inputParamsMap = mutableMapOf<String, JsonNode?>()
}
log.info("Getting the template prefixes")
- val prefixList: ArrayList<String> = getTemplatePrefixList(executionRequest)
+ val prefixList: ArrayList<String> = getTemplatePrefixList(inputParamsMap[INPUT_ARTIFACT_PREFIX_NAMES])
log.info("Iterating over prefixes in resource assignment map.")
for (prefix in prefixList) {
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, profileSource)
if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE)
- throw BluePrintProcessorException("Unexpected profile artifact type for profile source " +
- "$profileSource. Expecting: $artifact.type")
+ throw BluePrintProcessorException(
+ "Unexpected profile artifact type for profile source " +
+ "$profileSource. Expecting: $artifact.type"
+ )
var profile = K8sProfile()
profile.profileName = profileName
profile.rbName = definitionName
bluePrintRuntimeService.getBluePrintError().addError(runtimeException.message!!)
}
- fun getTemplatePrefixList(executionRequest: ExecutionServiceInput): ArrayList<String> {
- val result = ArrayList<String>()
- for (prefix in executionRequest.payload.get("resource-assignment-request").get("template-prefix").elements())
- result.add(prefix.asText())
+ private fun getTemplatePrefixList(node: JsonNode?): ArrayList<String> {
+ var result = ArrayList<String>()
+ when (node) {
+ is ArrayNode -> {
+ val arrayNode = node.toList()
+ for (prefixNode in arrayNode)
+ result.add(prefixNode.asText())
+ }
+ is ObjectNode -> {
+ result.add(node.asText())
+ }
+ }
return result
}
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val bluePrintBasePath: String = bluePrintContext.rootPath
val profileSourceFileFolderPath: String = bluePrintBasePath.plus(File.separator)
- .plus(ks8ProfileLocation)
+ .plus(ks8ProfileLocation)
val profileFilePathTarGz: String = profileSourceFileFolderPath.plus(".tar.gz")
val profileFilePathTgz: String = profileSourceFileFolderPath.plus(".tgz")
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE] = 1
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = false
val resolutionResult: Pair<String, JsonNode> = resourceResolutionService.resolveResources(
- bluePrintRuntimeService,
- nodeTemplateName,
- ks8ProfileSource,
- properties)
+ bluePrintRuntimeService,
+ nodeTemplateName,
+ ks8ProfileSource,
+ properties
+ )
val tempMainPath: File = createTempDir("k8s-profile-", "")
val tempProfilePath: File = createTempDir("content-", "", tempMainPath)
try {
- val manifestFiles: ArrayList<File>? = readManifestFiles(Paths.get(profileSourceFileFolderPath).toFile(),
- tempProfilePath)
+ val manifestFiles: ArrayList<File>? = readManifestFiles(
+ Paths.get(profileSourceFileFolderPath).toFile(),
+ tempProfilePath
+ )
if (manifestFiles != null) {
- templateLocation(Paths.get(profileSourceFileFolderPath).toFile(), resolutionResult.second,
- tempProfilePath, manifestFiles)
+ templateLocation(
+ Paths.get(profileSourceFileFolderPath).toFile(), resolutionResult.second,
+ tempProfilePath, manifestFiles
+ )
} else
throw BluePrintProcessorException("Manifest file is missing")
// Preparation of the final profile content
- val finalProfileFilePath = Paths.get(tempMainPath.toString().plus(File.separator).plus(
- "$k8sRbProfileName.tar.gz"))
- if (!BluePrintArchiveUtils.compress(tempProfilePath, finalProfileFilePath.toFile(),
- ArchiveType.TarGz)) {
+ val finalProfileFilePath = Paths.get(
+ tempMainPath.toString().plus(File.separator).plus(
+ "$k8sRbProfileName.tar.gz"
+ )
+ )
+ if (!BluePrintArchiveUtils.compress(
+ tempProfilePath, finalProfileFilePath.toFile(),
+ ArchiveType.TarGz
+ )
+ ) {
throw BluePrintProcessorException("Profile compression has failed")
}
FileUtils.deleteDirectory(tempProfilePath)
if (location.extension.toLowerCase() == "vtl") {
templateFile(location, params, destinationFolder, manifestFiles)
} else {
- val finalFilePath = Paths.get(destinationFolder.path.plus(File.separator)
- .plus(location.name)).toFile()
+ val finalFilePath = Paths.get(
+ destinationFolder.path.plus(File.separator)
+ .plus(location.name)
+ ).toFile()
if (isFileInTheManifestFiles(finalFilePath, manifestFiles)) {
if (!destinationFolder.exists())
Files.createDirectories(destinationFolder.toPath())
destinationFolder: File,
manifestFiles: ArrayList<File>
) {
- val finalFile = File(destinationFolder.path.plus(File.separator)
- .plus(templatedFile.nameWithoutExtension))
+ val finalFile = File(
+ destinationFolder.path.plus(File.separator)
+ .plus(templatedFile.nameWithoutExtension)
+ )
if (!isFileInTheManifestFiles(finalFile, manifestFiles))
return
val fileContent = templatedFile.bufferedReader().readText()
- val finalFileContent = BluePrintVelocityTemplateService.generateContent(fileContent,
- params, true)
+ val finalFileContent = BluePrintVelocityTemplateService.generateContent(
+ fileContent,
+ params, true
+ )
if (!destinationFolder.exists())
Files.createDirectories(destinationFolder.toPath())
finalFile.bufferedWriter().use { out -> out.write(finalFileContent) }
class K8sProfileUploadConstants {
companion object {
+
const val PREFIX_K8S_PLUGIN: String = "blueprintprocessor.k8s.plugin"
}
}
package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.profile.upload
open class K8sProfileUploadProperties {
+
var type: String = K8sProfileUploadConstants.PREFIX_K8S_PLUGIN
lateinit var url: String
lateinit var username: String
package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.profile.upload
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService
import org.apache.commons.io.IOUtils
+import org.apache.http.client.ClientProtocolException
import org.apache.http.client.entity.EntityBuilder
-import org.apache.http.message.BasicHeader
import org.apache.http.client.methods.HttpPost
import org.apache.http.client.methods.HttpUriRequest
-import org.apache.http.client.ClientProtocolException
-import java.io.IOException
-import java.nio.file.Files
-import java.nio.file.Path
+import org.apache.http.message.BasicHeader
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService
import org.springframework.http.HttpHeaders
import org.springframework.http.MediaType
+import java.io.IOException
import java.nio.charset.Charset
+import java.nio.file.Files
+import java.nio.file.Path
import java.util.Base64
class K8sUploadFileRestClientService(
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>message-prioritizaion</artifactId>
- <name>Blueprints Processor Function - Message Prioritization</name>
+ <name>MS Blueprints Processor Functions - Message Prioritization</name>
<description>Blueprints Processor Function - Message Prioritization</description>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>message-lib</artifactId>
</dependency>
<dependency>
import java.io.Serializable
object MessageActionConstants {
+
const val PRIORITIZE = "prioritize"
}
}
open class PrioritizationConfiguration : Serializable {
+
lateinit var expiryConfiguration: ExpiryConfiguration
lateinit var shutDownConfiguration: ShutDownConfiguration
lateinit var cleanConfiguration: CleanConfiguration
}
open class KafkaConfiguration : Serializable {
+
lateinit var inputTopicSelector: String // Consumer Configuration Selector
lateinit var expiredTopic: String // Publish Configuration Selector
lateinit var outputTopic: String // Publish Configuration Selector
}
open class NatsConfiguration : Serializable {
+
lateinit var connectionSelector: String // Consumer Configuration Selector
lateinit var inputSubject: String // Publish Configuration Selector
lateinit var expiredSubject: String // Publish Configuration Selector
}
open class ExpiryConfiguration : Serializable {
+
var frequencyMilli: Long = 30000L
var maxPollRecord: Int = 1000
}
open class ShutDownConfiguration : Serializable {
+
var waitMill: Long = 30000L
}
open class CleanConfiguration : Serializable {
+
var frequencyMilli: Long = 30000L
var expiredRecordsHoldDays: Int = 5
}
open class UpdateStateRequest : Serializable {
+
lateinit var id: String
var group: String? = null
var state: String? = null
open fun kafkaStreamConsumerFunction(prioritizationConfiguration: PrioritizationConfiguration):
KafkaStreamConsumerFunction {
- return object : KafkaStreamConsumerFunction {
-
- val kafkaConsumerConfiguration = prioritizationConfiguration.kafkaConfiguration
- ?: throw BluePrintProcessorException("failed to get kafka consumer configuration")
-
- override suspend fun createTopology(
- messageConsumerProperties: MessageConsumerProperties,
- additionalConfig: Map<String, Any>?
- ): Topology {
-
- val topology = Topology()
- val kafkaStreamsBasicAuthConsumerProperties = messageConsumerProperties
- as KafkaStreamsBasicAuthConsumerProperties
-
- val topics = kafkaStreamsBasicAuthConsumerProperties.topic.splitCommaAsList()
- log.info("Consuming prioritization topics($topics)")
-
- topology.addSource(MessagePrioritizationConstants.SOURCE_INPUT, *topics.toTypedArray())
-
- topology.addProcessor(
- MessagePrioritizationConstants.PROCESSOR_PRIORITIZE,
- bluePrintProcessorSupplier<ByteArray, ByteArray>(
+ return object : KafkaStreamConsumerFunction {
+
+ val kafkaConsumerConfiguration = prioritizationConfiguration.kafkaConfiguration
+ ?: throw BluePrintProcessorException("failed to get kafka consumer configuration")
+
+ override suspend fun createTopology(
+ messageConsumerProperties: MessageConsumerProperties,
+ additionalConfig: Map<String, Any>?
+ ): Topology {
+
+ val topology = Topology()
+ val kafkaStreamsBasicAuthConsumerProperties = messageConsumerProperties
+ as KafkaStreamsBasicAuthConsumerProperties
+
+ val topics = kafkaStreamsBasicAuthConsumerProperties.topic.splitCommaAsList()
+ log.info("Consuming prioritization topics($topics)")
+
+ topology.addSource(MessagePrioritizationConstants.SOURCE_INPUT, *topics.toTypedArray())
+
+ topology.addProcessor(
+ MessagePrioritizationConstants.PROCESSOR_PRIORITIZE,
+ bluePrintProcessorSupplier<ByteArray, ByteArray>(
+ MessagePrioritizationConstants.PROCESSOR_PRIORITIZE
+ ),
+ MessagePrioritizationConstants.SOURCE_INPUT
+ )
+
+ /** To receive completed and error messages */
+ topology.addSink(
+ MessagePrioritizationConstants.SINK_OUTPUT,
+ kafkaConsumerConfiguration.outputTopic,
+ Serdes.String().serializer(), MessagePrioritizationSerde().serializer(),
MessagePrioritizationConstants.PROCESSOR_PRIORITIZE
- ),
- MessagePrioritizationConstants.SOURCE_INPUT
- )
-
- /** To receive completed and error messages */
- topology.addSink(
- MessagePrioritizationConstants.SINK_OUTPUT,
- kafkaConsumerConfiguration.outputTopic,
- Serdes.String().serializer(), MessagePrioritizationSerde().serializer(),
- MessagePrioritizationConstants.PROCESSOR_PRIORITIZE
- )
-
- // Output will be sent to the group-output topic from Processor API
- return topology
+ )
+
+ // Output will be sent to the group-output topic from Processor API
+ return topology
+ }
}
}
- }
suspend fun startConsuming(prioritizationConfiguration: PrioritizationConfiguration) {
private val bluePrintNatsLibPropertyService: BluePrintNatsLibPropertyService,
private val natsMessagePrioritizationService: MessagePrioritizationService
) {
+
private val log = logger(NatsMessagePrioritizationConsumer::class)
lateinit var bluePrintNatsService: BluePrintNatsService
if (!messages.isNullOrEmpty()) {
try {
/** Implement Aggregation logic in overridden class, If necessary,
- Populate New Message and Update status with Prioritized, Forward the message to next processor */
+ Populate New Message and Update status with Prioritized, Forward the message to next processor */
handleAggregation(messages)
} catch (e: Exception) {
val error = "failed in aggregate message(${messages.ids()}) : ${e.message}"
} catch (sendException: Exception) {
log.error(
"failed to update/publish error message(${messagePrioritization.id}) : " +
- "${sendException.message}", e
+ "${sendException.message}",
+ e
)
}
}
open class MessagePrioritizationSchedulerService(
private val messagePrioritizationService: MessagePrioritizationService
) {
+
private val log = logger(MessagePrioritizationSchedulerService::class)
@Volatile
var keepGoing = true
/** This is sample scheduler implementation used during starting application with configuration.
- @EventListener(ApplicationReadyEvent::class)
- open fun init() = runBlocking {
- log.info("Starting PrioritizationListeners...")
- startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
- }
+ @EventListener(ApplicationReadyEvent::class)
+ open fun init() = runBlocking {
+ log.info("Starting PrioritizationListeners...")
+ startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
+ }
*/
open suspend fun startScheduling() {
override suspend fun getMessageForStatesNotExpiredIn(group: String, states: List<String>, count: Int):
List<MessagePrioritization>? {
- return prioritizationMessageRepository.findByGroupAndStateInAndNotExpiredDate(
- group,
- states, Date(), PageRequest.of(0, count)
- )
- }
+ return prioritizationMessageRepository.findByGroupAndStateInAndNotExpiredDate(
+ group,
+ states, Date(), PageRequest.of(0, count)
+ )
+ }
override suspend fun getMessageForStatesExpired(group: String, states: List<String>, count: Int):
List<MessagePrioritization>? {
- return prioritizationMessageRepository.findByGroupAndStateInAndExpiredDate(
- group,
- states, Date(), PageRequest.of(0, count)
- )
- }
+ return prioritizationMessageRepository.findByGroupAndStateInAndExpiredDate(
+ group,
+ states, Date(), PageRequest.of(0, count)
+ )
+ }
override suspend fun getExpiredMessages(expiryDate: Date, count: Int): List<MessagePrioritization>? {
return prioritizationMessageRepository.findByExpiredDate(
override suspend fun getExpiredMessages(group: String, expiryDate: Date, count: Int):
List<MessagePrioritization>? {
- return prioritizationMessageRepository.findByGroupAndExpiredDate(
- group,
- expiryDate, PageRequest.of(0, count)
- )
- }
+ return prioritizationMessageRepository.findByGroupAndExpiredDate(
+ group,
+ expiryDate, PageRequest.of(0, count)
+ )
+ }
override suspend fun getCorrelatedMessages(
group: String,
/** Assumption is message is of same group and checking for required types **/
fun correlatedMessagesWithTypes(collectedMessages: List<MessagePrioritization>, types: List<String>?):
- CorrelationCheckResponse {
+ CorrelationCheckResponse {
- return if (!types.isNullOrEmpty() && collectedMessages.size > 1) {
+ return if (!types.isNullOrEmpty() && collectedMessages.size > 1) {
- val unknownMessageTypes = collectedMessages.filter { !types.contains(it.type) }.map { it.id }
- if (!unknownMessageTypes.isNullOrEmpty()) {
- throw BluePrintProcessorException("Messages($unknownMessageTypes) is not in type of($types)")
- }
+ val unknownMessageTypes = collectedMessages.filter { !types.contains(it.type) }.map { it.id }
+ if (!unknownMessageTypes.isNullOrEmpty()) {
+ throw BluePrintProcessorException("Messages($unknownMessageTypes) is not in type of($types)")
+ }
- val copyTypes = types.toTypedArray().copyOf().toMutableList()
+ val copyTypes = types.toTypedArray().copyOf().toMutableList()
- val filteredMessage = collectedMessages.filter {
- !it.correlationId.isNullOrBlank() &&
+ val filteredMessage = collectedMessages.filter {
+ !it.correlationId.isNullOrBlank() &&
types.contains(it.type)
- }
- var correlatedKeys: MutableSet<String> = mutableSetOf()
- if (filteredMessage.isNotEmpty()) {
- val correlatedMap = filteredMessage.groupBy { it.toTypeNCorrelation() }
- val foundType = correlatedMap.keys.map { it.type }
- copyTypes.removeAll(foundType)
- correlatedKeys = correlatedMap.keys.map {
- it.correlationId
- }.toMutableSet()
- }
- /** Check if any Types missing and same correlation id for all types */
- return if (copyTypes.isEmpty()) {
- if (correlatedKeys.size == 1) CorrelationCheckResponse(correlated = true)
- else CorrelationCheckResponse(message = "not matching correlation keys($correlatedKeys)")
+ }
+ var correlatedKeys: MutableSet<String> = mutableSetOf()
+ if (filteredMessage.isNotEmpty()) {
+ val correlatedMap = filteredMessage.groupBy { it.toTypeNCorrelation() }
+ val foundType = correlatedMap.keys.map { it.type }
+ copyTypes.removeAll(foundType)
+ correlatedKeys = correlatedMap.keys.map {
+ it.correlationId
+ }.toMutableSet()
+ }
+ /** Check if any Types missing and same correlation id for all types */
+ return if (copyTypes.isEmpty()) {
+ if (correlatedKeys.size == 1) CorrelationCheckResponse(correlated = true)
+ else CorrelationCheckResponse(message = "not matching correlation keys($correlatedKeys)")
+ } else {
+ CorrelationCheckResponse(message = "couldn't find types($copyTypes)")
+ }
} else {
- CorrelationCheckResponse(message = "couldn't find types($copyTypes)")
+ return correlatedMessages(collectedMessages)
}
- } else {
- return correlatedMessages(collectedMessages)
}
- }
}
@DataJpaTest
@DirtiesContext
@ContextConfiguration(
- classes = [BluePrintMessageLibConfiguration::class, BluePrintNatsLibConfiguration::class,
+ classes = [
+ BluePrintMessageLibConfiguration::class, BluePrintNatsLibConfiguration::class,
BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class,
- MessagePrioritizationConfiguration::class, TestDatabaseConfiguration::class]
+ MessagePrioritizationConfiguration::class, TestDatabaseConfiguration::class
+ ]
)
@TestPropertySource(
properties =
- [
- "spring.jpa.show-sql=false",
- "spring.jpa.properties.hibernate.show_sql=false",
- "spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl",
-
- "blueprintsprocessor.messageconsumer.prioritize-input.type=kafka-streams-scram-ssl-auth",
- "blueprintsprocessor.messageconsumer.prioritize-input.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageconsumer.prioritize-input.applicationId=test-prioritize-application",
- "blueprintsprocessor.messageconsumer.prioritize-input.topic=prioritize-input-topic",
- "blueprintsprocessor.messageconsumer.prioritize-input.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageconsumer.prioritize-input.truststorePassword=truststorePassword",
- "blueprintsprocessor.messageconsumer.prioritize-input.keystore=/path/to/keystore.jks",
- "blueprintsprocessor.messageconsumer.prioritize-input.keystorePassword=keystorePassword",
- "blueprintsprocessor.messageconsumer.prioritize-input.scramUsername=test-user",
- "blueprintsprocessor.messageconsumer.prioritize-input.scramPassword=testUserPassword",
-
- // To send initial test message
- "blueprintsprocessor.messageproducer.prioritize-input.type=kafka-scram-ssl-auth",
- "blueprintsprocessor.messageproducer.prioritize-input.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageproducer.prioritize-input.topic=prioritize-input-topic",
- "blueprintsprocessor.messageproducer.prioritize-input.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageproducer.prioritize-input.truststorePassword=truststorePassword",
- "blueprintsprocessor.messageproducer.prioritize-input.keystore=/path/to/keystore.jks",
- "blueprintsprocessor.messageproducer.prioritize-input.keystorePassword=keystorePassword",
- "blueprintsprocessor.messageproducer.prioritize-input.scramUsername=test-user",
- "blueprintsprocessor.messageproducer.prioritize-input.scramPassword=testUserPassword",
-
- "blueprintsprocessor.nats.cds-controller.type=token-auth",
- "blueprintsprocessor.nats.cds-controller.host=nats://localhost:4222",
- "blueprintsprocessor.nats.cds-controller.token=tokenAuth"
- ]
+ [
+ "spring.jpa.show-sql=false",
+ "spring.jpa.properties.hibernate.show_sql=false",
+ "spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl",
+
+ "blueprintsprocessor.messageconsumer.prioritize-input.type=kafka-streams-scram-ssl-auth",
+ "blueprintsprocessor.messageconsumer.prioritize-input.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageconsumer.prioritize-input.applicationId=test-prioritize-application",
+ "blueprintsprocessor.messageconsumer.prioritize-input.topic=prioritize-input-topic",
+ "blueprintsprocessor.messageconsumer.prioritize-input.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageconsumer.prioritize-input.truststorePassword=truststorePassword",
+ "blueprintsprocessor.messageconsumer.prioritize-input.keystore=/path/to/keystore.jks",
+ "blueprintsprocessor.messageconsumer.prioritize-input.keystorePassword=keystorePassword",
+ "blueprintsprocessor.messageconsumer.prioritize-input.scramUsername=test-user",
+ "blueprintsprocessor.messageconsumer.prioritize-input.scramPassword=testUserPassword",
+
+ // To send initial test message
+ "blueprintsprocessor.messageproducer.prioritize-input.type=kafka-scram-ssl-auth",
+ "blueprintsprocessor.messageproducer.prioritize-input.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageproducer.prioritize-input.topic=prioritize-input-topic",
+ "blueprintsprocessor.messageproducer.prioritize-input.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageproducer.prioritize-input.truststorePassword=truststorePassword",
+ "blueprintsprocessor.messageproducer.prioritize-input.keystore=/path/to/keystore.jks",
+ "blueprintsprocessor.messageproducer.prioritize-input.keystorePassword=keystorePassword",
+ "blueprintsprocessor.messageproducer.prioritize-input.scramUsername=test-user",
+ "blueprintsprocessor.messageproducer.prioritize-input.scramPassword=testUserPassword",
+
+ "blueprintsprocessor.nats.cds-controller.type=token-auth",
+ "blueprintsprocessor.nats.cds-controller.host=nats://localhost:4222",
+ "blueprintsprocessor.nats.cds-controller.token=tokenAuth"
+ ]
)
open class MessagePrioritizationConsumerTest {
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>netconf-executor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - Netconf Executor</name>
+ <name>MS Blueprints Processor Functions - Netconf Executor</name>
<description>Blueprints Processor Function - Netconf Executor</description>
<dependencies>
AbstractComponentFunction() {
companion object {
+
const val SCRIPT_TYPE = "script-type"
const val SCRIPT_CLASS_REFERENCE = "script-class-reference"
const val INSTANCE_DEPENDENCIES = "instance-dependencies"
// Handles both script processing and error handling
scriptComponent.executeScript(executionServiceInput)
- componentFunctionScriptingService.cleanupInstance(bluePrintRuntimeService.bluePrintContext(),
- scriptType)
+ componentFunctionScriptingService.cleanupInstance(
+ bluePrintRuntimeService.bluePrintContext(),
+ scriptType
+ )
}
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core.NetconfSessionImpl
data class NetconfDevice(val deviceInfo: DeviceInfo) {
+
val netconfRpcService = NetconfRpcServiceImpl(deviceInfo)
val netconfSession: NetconfSession
val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(
requirement
- .node!!, requirement.capability!!
+ .node!!,
+ requirement.capability!!
)
return netconfDeviceInfo(capabilityProperties)
import com.fasterxml.jackson.annotation.JsonProperty
class DeviceInfo {
+
@get:JsonProperty("login-account")
var username: String? = null
+
@get:JsonProperty("login-key")
var password: String? = null
+
@get:JsonProperty("target-ip-address")
var ipAddress: String? = null
+
@get:JsonProperty("port-number")
var port: Int = 0
+
@get:JsonProperty("connection-time-out")
var connectTimeout: Long = 30
+
@get:JsonIgnore
var source: String? = null
+
@get:JsonProperty("reply-time-out")
var replyTimeout: Int = 30
+
@get:JsonIgnore
var idleTimeout: Int = 99999
package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api
interface NetconfSessionListener {
+
fun accept(event: NetconfReceivedEvent)
}
internal enum class NetconfMessageState {
NO_MATCHING_PATTERN {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
']' -> FIRST_BRACKET
}
},
FIRST_BRACKET {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
']' -> SECOND_BRACKET
}
},
SECOND_BRACKET {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
'>' -> FIRST_BIGGER
}
},
FIRST_BIGGER {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
']' -> THIRD_BRACKET
}
},
THIRD_BRACKET {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
']' -> ENDING_BIGGER
}
},
ENDING_BIGGER {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
'>' -> END_PATTERN
}
},
FIRST_LF {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
'#' -> FIRST_HASH
}
},
FIRST_HASH {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
'#' -> SECOND_HASH
}
},
SECOND_HASH {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return when (c) {
'\n' -> END_CHUNKED_PATTERN
}
},
END_CHUNKED_PATTERN {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return NO_MATCHING_PATTERN
}
},
END_PATTERN {
+
override fun evaluateChar(c: Char): NetconfMessageState {
return NO_MATCHING_PATTERN
}
try {
log.info(
"$deviceInfo: Connecting to Netconf Device with timeouts C:${deviceInfo.connectTimeout}, " +
- "R:${deviceInfo.replyTimeout}, I:${deviceInfo.idleTimeout}"
+ "R:${deviceInfo.replyTimeout}, I:${deviceInfo.idleTimeout}"
)
startConnection()
log.info("$deviceInfo: Connected to Netconf Device")
override fun disconnect() {
var retryNum = 3
while (rpcService.closeSession(false).status
- .equals(RpcStatus.FAILURE, true) && retryNum > 0
+ .equals(RpcStatus.FAILURE, true) && retryNum > 0
) {
log.error("disconnect: graceful disconnect failed, retrying $retryNum times...")
retryNum--
ImmutableSet.of(
ClientSession.ClientSessionEvent.WAIT_AUTH,
ClientSession.ClientSessionEvent.CLOSED, ClientSession.ClientSessionEvent.AUTHED
- ), 0
+ ),
+ 0
)
if (!event.contains(ClientSession.ClientSessionEvent.AUTHED)) {
throw NetconfException("$deviceInfo: Failed to authenticate session.")
}
object RpcStatus {
+
const val SUCCESS = "success"
const val FAILURE = "failure"
}
object RpcMessageUtils {
+
const val OPEN = "<"
const val CLOSE = ">"
const val EQUAL = "="
class NetconfMessageUtils {
companion object {
+
val log = LoggerFactory.getLogger(NetconfMessageUtils::class.java)
const val NEW_LINE = "\n"
if (!persist.isEmpty() && !persistId.isEmpty()) {
throw NetconfException(
"Can't proceed <commit> with both persist($persist) and " +
- "persistId($persistId) specified. Only one should be specified."
+ "persistId($persistId) specified. Only one should be specified."
)
}
if (confirmed && !persistId.isEmpty()) {
throw NetconfException(
"Can't proceed <commit> with both confirmed flag and " +
- "persistId($persistId) specified. Only one should be specified."
+ "persistId($persistId) specified. Only one should be specified."
)
}
if (!message.startsWith(RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH)) {
// chunk encode message
message =
- (RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH + message.toByteArray(UTF_8).size + RpcMessageUtils.NEW_LINE + message + RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH + RpcMessageUtils.HASH +
- RpcMessageUtils.NEW_LINE)
+ (
+ RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH + message.toByteArray(UTF_8).size + RpcMessageUtils.NEW_LINE + message + RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH + RpcMessageUtils.HASH +
+ RpcMessageUtils.NEW_LINE
+ )
}
return message
}
if (!request.contains(RpcMessageUtils.XML_HEADER)) {
if (request.startsWith(RpcMessageUtils.NEW_LINE + RpcMessageUtils.HASH)) {
request =
- request.split("<".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0] + RpcMessageUtils.XML_HEADER + request.substring(
- request.split("<".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0].length
- )
+ request.split("<".toRegex()).dropLastWhile { it.isEmpty() }
+ .toTypedArray()[0] + RpcMessageUtils.XML_HEADER + request.substring(
+ request.split("<".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0].length
+ )
} else {
request = RpcMessageUtils.XML_HEADER + "\n" + request
}
import kotlin.test.assertEquals
class DeviceInfoTest {
+
@Test
fun testToString() {
import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.RpcStatus
class NetconfMessageTest {
+
@Test
fun testSuccessfulDeviceResponse() {
val dr: DeviceResponse = genSuccessfulEmptyDeviceResponse()
import kotlin.test.assertTrue
class NetconfDeviceCommunicatorTest {
+
private lateinit var netconfSession: NetconfSession
private lateinit var netconfSessionListener: NetconfSessionListener
private lateinit var mockInputStream: InputStream
private val endPatternCharArray: List<Int> = stringToCharArray(RpcMessageUtils.END_PATTERN)
companion object {
+
private val chunkedEnding = "\n##\n"
+
// using example from section 4.2 of RFC6242 (https://tools.ietf.org/html/rfc6242#section-4.2)
private val validChunkedEncodedMsg = """
|
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<close-session/>
</rpc>
- """.trimIndent(), eventSlot.captured.messagePayload
+ """.trimIndent(),
+ eventSlot.captured.messagePayload
)
}
import kotlin.test.assertTrue
class NetconfRpcServiceImplTest {
+
private lateinit var mockNetconfSession: NetconfSessionImpl
companion object {
+
private const val someString = "someString"
private const val replyStr = "this is a reply"
private val failedDeviceResponse = DeviceResponse(
status = RpcStatus.SUCCESS,
requestMessage = "request message", responseMessage = replyStr
) // responseMessage will be null in this POJO
+
// but will be set later from mockSession
private const val msgId = "100"
private const val timeout = 5
class NetconfSessionImplTest {
companion object {
+
val SUCCESSFUL_DEVICE_RESPONSE = DeviceResponse().apply {
status = RpcStatus.SUCCESS
errorMessage = ""
// rpcService.closeSession succeeds with status not RpcStatus.FAILURE
val netconfSessionSpy = spyk(netconfSession, recordPrivateCalls = true)
every { rpcService.closeSession(any()) } returns
- FAILED_DEVICE_RESPONSE andThen SUCCESSFUL_DEVICE_RESPONSE
+ FAILED_DEVICE_RESPONSE andThen SUCCESSFUL_DEVICE_RESPONSE
every { mockClientSession.close() } just Runs
every { mockSshClient.close() } just Runs
every { mockClientChannel.close() } just Runs
// make sure the replies didn't change
assertTrue {
netconfSessionSpy.getReplies().size == 1 &&
- netconfSessionSpy.getReplies().containsKey("somekey")
+ netconfSessionSpy.getReplies().containsKey("somekey")
}
verify(exactly = 0) { netconfSessionSpy.clearReplies() }
}
val futureRet: CompletableFuture<String> = CompletableFuture.completedFuture(futureMsg)
every { netconfCommunicator.sendMessage(any(), any()) } returns futureRet
every { netconfCommunicator.getFutureFromSendMessage(any(), any(), any()) } throws
- ExecutionException("exec exception", Exception("nested exception"))
+ ExecutionException("exec exception", Exception("nested exception"))
every { netconfSessionSpy["close"]() as Unit } just Runs
every { netconfSessionSpy.checkAndReestablish() } just Runs
netconfSessionSpy.setSession(mockClientSession)
val futureRet: CompletableFuture<String> = CompletableFuture.completedFuture(futureMsg)
every { netconfCommunicator.sendMessage(any(), any()) } returns futureRet
every { netconfCommunicator.getFutureFromSendMessage(any(), any(), any()) } throws
- ExecutionException("exec exception", Exception("nested exception"))
+ ExecutionException("exec exception", Exception("nested exception"))
every { netconfSessionSpy["close"]() as Unit } throws IOException("got an IO exception")
every { netconfSessionSpy.checkAndReestablish() } just Runs
// call the method
succeededSessionFuture.value = mockClientSession
every { mockSshClient.connect(deviceInfo.username, deviceInfo.ipAddress, deviceInfo.port) } returns succeededSessionFuture
every { mockClientSession.waitFor(any(), any()) } returns
- setOf(ClientSession.ClientSessionEvent.WAIT_AUTH, ClientSession.ClientSessionEvent.CLOSED)
+ setOf(ClientSession.ClientSessionEvent.WAIT_AUTH, ClientSession.ClientSessionEvent.CLOSED)
val netconfSessionSpy = spyk(netconfSession, recordPrivateCalls = true)
every { netconfSessionSpy["setupNewSSHClient"]() as Unit } just Runs
netconfSessionSpy.setClient(mockSshClient)
succeededSessionFuture.value = mockClientSession
every { mockSshClient.connect(deviceInfo.username, deviceInfo.ipAddress, deviceInfo.port) } returns succeededSessionFuture
every { mockClientSession.waitFor(any(), any()) } returns
- setOf(
- ClientSession.ClientSessionEvent.WAIT_AUTH,
- ClientSession.ClientSessionEvent.CLOSED,
- ClientSession.ClientSessionEvent.AUTHED
- )
+ setOf(
+ ClientSession.ClientSessionEvent.WAIT_AUTH,
+ ClientSession.ClientSessionEvent.CLOSED,
+ ClientSession.ClientSessionEvent.AUTHED
+ )
every { mockClientSession.createSubsystemChannel(any()) } returns mockSubsystem
every { mockClientChannel.invertedOut } returns sampleInputStream
import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfReceivedEvent
class NetconfSessionListenerImplTest {
+
// Note: mockk's verifyAll is akin to verify with verifyNoMoreInteractions in Mockito
private val netconSession = mockk<NetconfSessionImpl>()
@Test
fun getConfig() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<get-config><source><candidate/></source><filter type=\"subtree\">Test-Filter-Content</filter>" +
- "</get-config></rpc>")
+ "</get-config></rpc>"
+ )
val messageId = "Test-Message-ID"
val configType = NetconfDatastore.CANDIDATE.datastore
@Test
fun editConfig() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<edit-config><target><candidate/></target><default-operation>Test-Default-Operation</default-operation>" +
- "<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">Test-Filter-Content</config></edit-config></rpc>")
+ "<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">Test-Filter-Content</config></edit-config></rpc>"
+ )
val messageId = "Test-Message-ID"
val configType = NetconfDatastore.CANDIDATE.datastore
@Test
fun validate() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<validate><source><candidate/></source></validate></rpc>")
+ "<validate><source><candidate/></source></validate></rpc>"
+ )
val messageId = "Test-Message-ID"
val configType = NetconfDatastore.CANDIDATE.datastore
@Test
fun cancelCommit() {
val checkString =
- ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<cancel-commit>" +
"<persist-id>1234</persist-id>" +
- "</cancel-commit></rpc>")
+ "</cancel-commit></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun cancelCommitNoPersistId() {
val checkString =
- ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<cancel-commit>" +
- "</cancel-commit></rpc>")
+ "</cancel-commit></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun commit() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<commit></commit></rpc>")
+ "<commit></commit></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun commitPersistId() {
val checkString =
- ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<commit>" +
"<persist-id>1234</persist-id>" +
- "</commit></rpc>")
+ "</commit></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun commitPersist() {
val checkString =
- ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
"<commit>" +
"<confirmed/>" +
"<confirm-timeout>30</confirm-timeout>" +
"<persist>1234</persist>" +
- "</commit></rpc>")
+ "</commit></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun unlock() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<unlock><target><candidate/></target></unlock></rpc>")
+ "<unlock><target><candidate/></target></unlock></rpc>"
+ )
val messageId = "Test-Message-ID"
val configType = NetconfDatastore.CANDIDATE.datastore
@Test
fun deleteConfig() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<delete-config><target><candidate/></target></delete-config></rpc>")
+ "<delete-config><target><candidate/></target></delete-config></rpc>"
+ )
val messageId = "Test-Message-ID"
val netconfTargetConfig = NetconfDatastore.CANDIDATE.datastore
@Test
fun discardChanges() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<discard-changes/></rpc>")
+ "<discard-changes/></rpc>"
+ )
val messageId = "Test-Message-ID"
@Test
fun lock() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<rpc message-id=\"Test-Message-ID\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" +
- "<lock><target><candidate/></target></lock></rpc>")
+ "<lock><target><candidate/></target></lock></rpc>"
+ )
val messageId = "Test-Message-ID"
val configType = NetconfDatastore.CANDIDATE.datastore
@Test
fun createHelloString() {
- val checkString = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> " +
- "<capabilities> <capability>hi</capability> <capability>hello</capability> </capabilities></hello>]]>]]>")
+ val checkString = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> " +
+ "<capabilities> <capability>hi</capability> <capability>hello</capability> </capabilities></hello>]]>]]>"
+ )
val capability = listOf<String>("hi", "hello")
@Test
fun formatRPCRequest() {
- val checkString = ("#199" +
+ val checkString = (
+ "#199" +
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> <capabilities> <capability>hi</capability> <capability>hello</capability> </capabilities></hello>" +
- "##")
+ "##"
+ )
- val request = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> " +
- "<capabilities> <capability>hi</capability> <capability>hello</capability> </capabilities></hello>]]>]]>")
+ val request = (
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> " +
+ "<capabilities> <capability>hi</capability> <capability>hello</capability> </capabilities></hello>]]>]]>"
+ )
val messageId = "Test-Message-ID"
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
- <artifactId>functions</artifactId>
+ <artifactId>blueprintsprocessor-functions</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Functions</name>
- <description>Blueprints Processor Functions</description>
+ <name>MS Blueprints Processor Functions (Root)</name>
<modules>
<module>resource-resolution</module>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>execution-service</artifactId>
</dependency>
<!-- Test Dependencies -->
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>python-executor</artifactId>
- <name>Blueprints Processor Function - Python Executor</name>
+ <name>MS Blueprints Processor Functions - Python Executor</name>
<description>Blueprints Processor Function - Python Executor</description>
<dependencies>
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
bluePrintRuntimeService.getBluePrintError()
- .addError("Failed in ComponentJythonExecutor : ${runtimeException.message}")
+ .addError("Failed in ComponentJythonExecutor : ${runtimeException.message}")
}
private suspend fun populateJythonComponentInstance() {
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val operationAssignment: OperationAssignment = bluePrintContext
- .nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName)
+ .nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName)
val artifactName: String = operationAssignment.implementation?.primary
- ?: throw BluePrintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)")
+ ?: throw BluePrintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)")
val artifactDefinition = bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName)
val pythonFileName = artifactDefinition.file
- ?: throw BluePrintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)")
+ ?: throw BluePrintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)")
val pythonClassName = FilenameUtils.getBaseName(pythonFileName)
checkNotEmpty(content) { "artifact ($artifactName) content is empty" }
val instanceDependenciesNode: ArrayNode = operationInputs[PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES] as? ArrayNode
- ?: throw BluePrintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})")
+ ?: throw BluePrintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})")
val jythonInstance: MutableMap<String, Any> = hashMapOf()
jythonInstance["log"] = LoggerFactory.getLogger(pythonClassName)
private val log = LoggerFactory.getLogger(ComponentRemotePythonExecutor::class.java)!!
companion object {
+
const val SELECTOR_CMD_EXEC = "blueprintsprocessor.remote-script-command"
const val INPUT_ENDPOINT_SELECTOR = "endpoint-selector"
const val INPUT_DYNAMIC_PROPERTIES = "dynamic-properties"
subRequestId = executionServiceInput.commonHeader.subRequestId,
remoteIdentifier = RemoteIdentifier(
blueprintName = blueprintName,
- blueprintVersion = blueprintVersion),
+ blueprintVersion = blueprintVersion
+ ),
packages = packages,
timeOut = envPrepTimeout.toLong()
// in cases where the exception is caught in BP side due to timeout, we do not have `err_msg` returned by cmd-exec (inside `payload`),
// hence `artifact` field will be empty
} catch (grpcEx: io.grpc.StatusRuntimeException) {
- val componentLevelWarningMsg = if (timeout < envPrepTimeout) "Note: component-level timeout ($timeout) is shorter than env-prepare timeout ($envPrepTimeout). " else ""
- val grpcErrMsg = "Command failed during env. preparation... timeout($envPrepTimeout) requestId ($processId).$componentLevelWarningMsg grpcError: (${grpcEx.cause?.message})"
+ val componentLevelWarningMsg =
+ if (timeout < envPrepTimeout) "Note: component-level timeout ($timeout) is shorter than env-prepare timeout ($envPrepTimeout). " else ""
+ val grpcErrMsg =
+ "Command failed during env. preparation... timeout($envPrepTimeout) requestId ($processId).$componentLevelWarningMsg grpcError: (${grpcEx.cause?.message})"
// no execution log in case of timeout (as cmd-exec side hasn't finished to transfer output)
// set prepare-env-log to the error msg, and cmd-exec-log to empty
setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, grpcErrMsg.asJsonPrimitive())
addError(StatusType.FAILURE.name, STEP_PREPARE_ENV, grpcErrMsg)
log.error(grpcErrMsg, grpcEx)
} catch (e: Exception) {
- val catchallErrMsg = "Command executor failed during env. preparation.. catch-all case. timeout($envPrepTimeout) requestId ($processId). exception msg: ${e.message}"
+ val catchallErrMsg =
+ "Command executor failed during env. preparation.. catch-all case. timeout($envPrepTimeout) requestId ($processId). exception msg: ${e.message}"
// no environment prepare log from executor in case of timeout (as cmd-exec side hasn't finished to transfer output), set it to error msg. Execution logs is empty.
setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, catchallErrMsg.asJsonPrimitive())
setNodeOutputErrors(STEP_PREPARE_ENV, "[]".asJsonPrimitive(), "{}".asJsonPrimitive(), isLogResponseEnabled)
remoteIdentifier = RemoteIdentifier(blueprintName = blueprintName, blueprintVersion = blueprintVersion),
command = scriptCommand,
properties = properties,
- timeOut = executionTimeout.toLong())
+ timeOut = executionTimeout.toLong()
+ )
val remoteExecutionOutputDeferred = GlobalScope.async {
remoteScriptExecutionService.executeCommand(remoteExecutionInput)
setNodeOutputProperties(remoteExecutionOutput.status, STEP_EXEC_CMD, logs, returnedPayload, isLogResponseEnabled)
} // In timeout exception cases, we don't have payload, hence `payload` is empty value.
} catch (timeoutEx: TimeoutCancellationException) {
- val componentLevelWarningMsg = if (timeout < executionTimeout) "Note: component-level timeout ($timeout) is shorter than execution timeout ($executionTimeout). " else ""
- val timeoutErrMsg = "Command executor execution timeout. DetailedMessage: (${timeoutEx.message}) requestId ($processId). $componentLevelWarningMsg"
+ val componentLevelWarningMsg =
+ if (timeout < executionTimeout) "Note: component-level timeout ($timeout) is shorter than execution timeout ($executionTimeout). " else ""
+ val timeoutErrMsg =
+ "Command executor execution timeout. DetailedMessage: (${timeoutEx.message}) requestId ($processId). $componentLevelWarningMsg"
setNodeOutputErrors(STEP_EXEC_CMD, listOf(timeoutErrMsg).asJsonPrimitive(), logging = isLogResponseEnabled)
addError(StatusType.FAILURE.name, STEP_EXEC_CMD, timeoutErrMsg)
log.error(timeoutErrMsg, timeoutEx)
} catch (grpcEx: io.grpc.StatusRuntimeException) {
- val timeoutErrMsg = "Command executor timed out executing after $executionTimeout seconds requestId ($processId) grpcErr: ${grpcEx.status}"
+ val timeoutErrMsg =
+ "Command executor timed out executing after $executionTimeout seconds requestId ($processId) grpcErr: ${grpcEx.status}"
setNodeOutputErrors(STEP_EXEC_CMD, listOf(timeoutErrMsg).asJsonPrimitive(), logging = isLogResponseEnabled)
addError(StatusType.FAILURE.name, STEP_EXEC_CMD, timeoutErrMsg)
log.error(timeoutErrMsg, grpcEx)
} catch (e: Exception) {
- val catchAllErrMsg = "Command executor failed during process catch-all case requestId ($processId) timeout($envPrepTimeout) exception msg: ${e.message}"
+ val catchAllErrMsg =
+ "Command executor failed during process catch-all case requestId ($processId) timeout($envPrepTimeout) exception msg: ${e.message}"
setNodeOutputErrors(STEP_PREPARE_ENV, listOf(catchAllErrMsg).asJsonPrimitive(), logging = isLogResponseEnabled)
addError(StatusType.FAILURE.name, STEP_EXEC_CMD, catchAllErrMsg)
log.error(catchAllErrMsg, e)
description: String,
block: ComponentRemotePythonExecutorNodeTemplateBuilder.() -> Unit
):
- NodeTemplate {
- return ComponentRemotePythonExecutorNodeTemplateBuilder(id, description).apply(block).build()
-}
+ NodeTemplate {
+ return ComponentRemotePythonExecutorNodeTemplateBuilder(id, description).apply(block).build()
+ }
class DtSystemPackageDataTypeBuilder : PropertiesAssignmentBuilder() {
class ComponentRemotePythonExecutorNodeTemplateBuilder(id: String, description: String) :
AbstractNodeTemplateOperationImplBuilder<PropertiesAssignmentBuilder, ComponentRemotePythonExecutorNodeTemplateBuilder.InputsBuilder,
- ComponentRemotePythonExecutorNodeTemplateBuilder.OutputsBuilder>(
+ ComponentRemotePythonExecutorNodeTemplateBuilder.OutputsBuilder>(
id, "component-remote-python-executor",
"ComponentRemotePythonExecutor", description
) {
override fun jythonComponentInstance(bluePrintContext: BluePrintContext, scriptClassReference: String):
BlueprintFunctionNode<*, *> {
- val pythonFileName = bluePrintContext.rootPath
- .plus(File.separator)
- .plus(scriptClassReference)
+ val pythonFileName = bluePrintContext.rootPath
+ .plus(File.separator)
+ .plus(scriptClassReference)
- val pythonClassName = FilenameUtils.getBaseName(pythonFileName)
- log.info("Getting Jython Script Class($pythonClassName)")
+ val pythonClassName = FilenameUtils.getBaseName(pythonFileName)
+ log.info("Getting Jython Script Class($pythonClassName)")
- val content: String = JacksonUtils.getContent(pythonFileName)
+ val content: String = JacksonUtils.getContent(pythonFileName)
- val jythonInstances: MutableMap<String, Any> = hashMapOf()
- jythonInstances["log"] = LoggerFactory.getLogger(pythonClassName)
+ val jythonInstances: MutableMap<String, Any> = hashMapOf()
+ jythonInstances["log"] = LoggerFactory.getLogger(pythonClassName)
- return jythonInstance<BlueprintFunctionNode<*, *>>(
- bluePrintContext, pythonClassName,
- content, jythonInstances
- )
- }
+ return jythonInstance<BlueprintFunctionNode<*, *>>(
+ bluePrintContext, pythonClassName,
+ content, jythonInstances
+ )
+ }
suspend fun jythonComponentInstance(abstractComponentFunction: AbstractComponentFunction): AbstractComponentFunction {
@Deprecated("CDS won't support JythonService")
open class BlueprintPythonHost(private val bluePrintPython: BluePrintPython) {
+
private val blueprintPythonInterpreterProxy: BlueprintPythonInterpreterProxy
init {
return blueprintPythonInterpreterProxy.getPythonInstance(properties)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to get python instance."
- throw e.updateErrorMessage(ExecutionServiceDomains.PYTHON_EXECUTOR, errorMsg,
- "Error in environment properties")
+ throw e.updateErrorMessage(
+ ExecutionServiceDomains.PYTHON_EXECUTOR, errorMsg,
+ "Error in environment properties"
+ )
} catch (e: Exception) {
throw BluePrintProcessorException("Failed to execute Jython component $e", e)
}
@Value("\${blueprints.processor.functions.python.executor.executionPath}")
lateinit var executionPath: String
+
@Value("#{'\${blueprints.processor.functions.python.executor.modulePaths}'.split(',')}")
lateinit var modulePaths: List<String>
}
@Deprecated("CDS won't support JythonService")
class PythonExecutorConstants {
+
companion object {
+
const val INPUT_INSTANCE_DEPENDENCIES = "instance-dependencies"
}
}
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [PythonExecutorConfiguration::class, PythonExecutorProperty::class,
- ComponentJythonExecutor::class, MockInstanceConfiguration::class]
+ classes = [
+ PythonExecutorConfiguration::class, PythonExecutorProperty::class,
+ ComponentJythonExecutor::class, MockInstanceConfiguration::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints",
- "blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints"]
+ [
+ "blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints",
+ "blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints"
+ ]
)
class ComponentJythonExecutorTest {
"prop1" : "1234",
"prop2" : true,
"prop3" : 23
- }""".trimIndent()
+ }
+ """.trimIndent()
)
argumentProperties("""["one", "two"]""")
packages {
val remoteScriptExecutionService = MockRemoteScriptExecutionService()
val componentRemotePythonExecutor = ComponentRemotePythonExecutor(
- remoteScriptExecutionService,
- mockk<BluePrintPropertiesService>()
+ remoteScriptExecutionService,
+ mockk<BluePrintPropertiesService>()
)
val executionServiceInput =
runBlocking {
val remoteScriptExecutionService = MockRemoteScriptExecutionService()
val componentRemotePythonExecutor = ComponentRemotePythonExecutor(
- remoteScriptExecutionService,
- mockk<BluePrintPropertiesService>()
+ remoteScriptExecutionService,
+ mockk<BluePrintPropertiesService>()
)
val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("123456-1000")
*/
fun getMockedOutput(svc: DefaultBluePrintRuntimeService):
ExecutionServiceInput {
- val stepMetaData: MutableMap<String, JsonNode> = hashMapOf()
-
- stepMetaData.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE,
- "execute-remote-python"
- )
- stepMetaData.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_INTERFACE,
- "ComponentRemotePythonExecutor"
- )
- stepMetaData.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process"
- )
-
- val mapper = ObjectMapper()
- val rootNode = mapper.createObjectNode()
- rootNode.put("ip-address", "0.0.0.0")
- rootNode.put("type", "rest")
-
- val operationalInputs: MutableMap<String, JsonNode> = hashMapOf()
- operationalInputs.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE,
- "execute-remote-python"
- )
- operationalInputs.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_INTERFACE,
- "ComponentRemotePythonExecutor"
- )
- operationalInputs.putJsonElement(
- BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process"
- )
- operationalInputs.putJsonElement("endpoint-selector", "aai")
- operationalInputs.putJsonElement("dynamic-properties", rootNode)
- operationalInputs.putJsonElement("command", "./run.sh")
- operationalInputs.putJsonElement("packages", "py")
-
- every {
- svc.resolveNodeTemplateInterfaceOperationInputs(
- "execute-remote-python",
- "ComponentRemotePythonExecutor", "process"
- )
- } returns operationalInputs
-
- val stepInputData = StepData().apply {
- name = "execute-remote-python"
- properties = stepMetaData
- }
-
- val executionServiceInput = JacksonUtils
- .readValueFromClassPathFile(
- "payload/requests/sample-remote-python-request.json",
- ExecutionServiceInput::class.java
- )!!
- executionServiceInput.stepData = stepInputData
+ val stepMetaData: MutableMap<String, JsonNode> = hashMapOf()
- val operationOutputs = hashMapOf<String, JsonNode>()
- every {
- svc.resolveNodeTemplateInterfaceOperationOutputs(
- "execute-remote-python",
- "ComponentRemotePythonExecutor", "process"
+ stepMetaData.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE,
+ "execute-remote-python"
)
- } returns operationOutputs
- val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime(
- "123456-1000",
- "./../../../../components/model-" +
- "catalog/blueprint-model/test-blueprint/" +
- "remote_scripts"
- )
- every {
- svc.resolveNodeTemplateArtifactDefinition(
- "execute-remote-python", "component-script"
+ stepMetaData.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_INTERFACE,
+ "ComponentRemotePythonExecutor"
)
- } returns bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(
- "execute-remote-python", "component-script"
- )
- every {
- svc.setNodeTemplateAttributeValue(
- "execute-remote-python", "prepare-environment-logs",
- "prepared successfully".asJsonPrimitive()
+ stepMetaData.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process"
)
- } returns Unit
- every {
- svc.setNodeTemplateAttributeValue(
- "execute-remote-python",
- "execute-command-logs", "N/A".asJsonPrimitive()
+
+ val mapper = ObjectMapper()
+ val rootNode = mapper.createObjectNode()
+ rootNode.put("ip-address", "0.0.0.0")
+ rootNode.put("type", "rest")
+
+ val operationalInputs: MutableMap<String, JsonNode> = hashMapOf()
+ operationalInputs.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE,
+ "execute-remote-python"
)
- } returns Unit
- every {
- svc.setNodeTemplateAttributeValue(
- "execute-remote-python",
- "execute-command-logs",
- "processed successfully".asJsonPrimitive()
+ operationalInputs.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_INTERFACE,
+ "ComponentRemotePythonExecutor"
)
- } returns Unit
+ operationalInputs.putJsonElement(
+ BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process"
+ )
+ operationalInputs.putJsonElement("endpoint-selector", "aai")
+ operationalInputs.putJsonElement("dynamic-properties", rootNode)
+ operationalInputs.putJsonElement("command", "./run.sh")
+ operationalInputs.putJsonElement("packages", "py")
+
+ every {
+ svc.resolveNodeTemplateInterfaceOperationInputs(
+ "execute-remote-python",
+ "ComponentRemotePythonExecutor", "process"
+ )
+ } returns operationalInputs
- every {
- svc.resolveDSLExpression("aai")
- } returns """{"url" : "http://xxx.com"}""".asJsonType()
+ val stepInputData = StepData().apply {
+ name = "execute-remote-python"
+ properties = stepMetaData
+ }
- every {
- svc.bluePrintContext()
- } returns bluePrintRuntimeService.bluePrintContext()
- return executionServiceInput
- }
+ val executionServiceInput = JacksonUtils
+ .readValueFromClassPathFile(
+ "payload/requests/sample-remote-python-request.json",
+ ExecutionServiceInput::class.java
+ )!!
+ executionServiceInput.stepData = stepInputData
+
+ val operationOutputs = hashMapOf<String, JsonNode>()
+ every {
+ svc.resolveNodeTemplateInterfaceOperationOutputs(
+ "execute-remote-python",
+ "ComponentRemotePythonExecutor", "process"
+ )
+ } returns operationOutputs
+ val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime(
+ "123456-1000",
+ "./../../../../components/model-" +
+ "catalog/blueprint-model/test-blueprint/" +
+ "remote_scripts"
+ )
+ every {
+ svc.resolveNodeTemplateArtifactDefinition(
+ "execute-remote-python", "component-script"
+ )
+ } returns bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(
+ "execute-remote-python", "component-script"
+ )
+ every {
+ svc.setNodeTemplateAttributeValue(
+ "execute-remote-python", "prepare-environment-logs",
+ "prepared successfully".asJsonPrimitive()
+ )
+ } returns Unit
+ every {
+ svc.setNodeTemplateAttributeValue(
+ "execute-remote-python",
+ "execute-command-logs", "N/A".asJsonPrimitive()
+ )
+ } returns Unit
+ every {
+ svc.setNodeTemplateAttributeValue(
+ "execute-remote-python",
+ "execute-command-logs",
+ "processed successfully".asJsonPrimitive()
+ )
+ } returns Unit
+
+ every {
+ svc.resolveDSLExpression("aai")
+ } returns """{"url" : "http://xxx.com"}""".asJsonType()
+
+ every {
+ svc.bluePrintContext()
+ } returns bluePrintRuntimeService.bluePrintContext()
+ return executionServiceInput
+ }
}
class MockRemoteScriptExecutionService : RemoteScriptExecutionService {
+
override suspend fun init(selector: Any) {
}
@ContextConfiguration(classes = [BluePrintPython::class, PythonExecutorProperty::class, String::class])
@TestPropertySource(
properties =
- ["blueprints.processor.functions.python.executor.modulePaths=./../../../../../components/scripts/python/ccsdk_blueprints",
- "blueprints.processor.functions.python.executor.executionPath=./../../../../../components/scripts/python/ccsdk_blueprints"]
+ [
+ "blueprints.processor.functions.python.executor.modulePaths=./../../../../../components/scripts/python/ccsdk_blueprints",
+ "blueprints.processor.functions.python.executor.executionPath=./../../../../../components/scripts/python/ccsdk_blueprints"
+ ]
)
class BlueprintPythonHostTest {
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>resource-resolution</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Blueprints Processor Function - Resource Resolution</name>
+ <name>MS Blueprints Processor Functions - Resource Resolution</name>
<description>Blueprints Processor Function - Resource Resolution</description>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>db-lib</artifactId>
</dependency>
<dependency>
/** Resource Definition DSL **/
fun BluePrintTypes.resourceDefinitions(block: ResourceDefinitionsBuilder.() -> Unit):
- MutableMap<String, ResourceDefinition> {
- return ResourceDefinitionsBuilder().apply(block).build()
-}
+ MutableMap<String, ResourceDefinition> {
+ return ResourceDefinitionsBuilder().apply(block).build()
+ }
fun BluePrintTypes.resourceDefinition(
name: String,
/** Resource Mapping DSL **/
fun BluePrintTypes.resourceAssignments(block: ResourceAssignmentsBuilder.() -> Unit):
- MutableMap<String, ResourceAssignment> {
- return ResourceAssignmentsBuilder().apply(block).build()
-}
+ MutableMap<String, ResourceAssignment> {
+ return ResourceAssignmentsBuilder().apply(block).build()
+ }
fun BluePrintTypes.resourceAssignment(
name: String,
}
class ResourceDefinitionsBuilder() {
+
private val resourceDefinitions: MutableMap<String, ResourceDefinition> = hashMapOf()
fun resourceDefinition(
}
class ResourceDefinitionBuilder(private val name: String, private val description: String) {
+
private val resourceDefinition = ResourceDefinition()
fun updatedBy(updatedBy: String) {
}
class ResourceDefinitionSourcesBuilder {
+
var sources: MutableMap<String, NodeTemplate> = hashMapOf()
fun source(source: NodeTemplate) {
}
class ResourceAssignmentsBuilder() {
+
private val resourceAssignments: MutableMap<String, ResourceAssignment> = hashMapOf()
fun resourceAssignment(
AbstractComponentFunction() {
companion object {
+
const val INPUT_REQUEST_ID = "request-id"
const val INPUT_RESOURCE_ID = "resource-id"
const val INPUT_ACTION_NAME = "action-name"
val resourceType =
getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_TYPE)?.returnNullIfMissing()?.textValue() ?: ""
val resolutionSummary =
- getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY)?.asBoolean() ?: false
+ getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY)?.asBoolean() ?: false
val properties: MutableMap<String, Any> = mutableMapOf()
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT] = storeResult
} else if (resourceType.isEmpty() && resourceId.isEmpty() && resolutionKey.isEmpty()) {
throw BluePrintProcessorException(
"Can't proceed with the resolution: can't persist resolution without a correlation key. " +
- "Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false."
+ "Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false."
)
}
}
property(
ResourceResolutionComponent.INPUT_RESOLUTION_SUMMARY, BluePrintConstants.DATA_TYPE_BOOLEAN,
- false, "Enables ResolutionSummary output"
+ false, "Enables ResolutionSummary output"
)
property(
*/
fun AbstractComponentFunction.storedContentFromResolvedArtifact(resolutionKey: String, artifactName: String):
- String = runBlocking {
- storedContentFromResolvedArtifactNB(resolutionKey, artifactName)
-}
+ String = runBlocking {
+ storedContentFromResolvedArtifactNB(resolutionKey, artifactName)
+ }
fun AbstractComponentFunction.contentFromResolvedArtifact(artifactPrefix: String): String = runBlocking {
contentFromResolvedArtifactNB(artifactPrefix)
false
) as Boolean
val assignmentMap = resourceAssignments
- .associateBy({ it.name }, { it.property?.value })
- .asJsonNode()
+ .associateBy({ it.name }, { it.property?.value })
+ .asJsonNode()
val resolvedParamJsonContent =
ResourceAssignmentUtils.generateResourceDataForAssignments(resourceAssignments.toList())
val artifactTemplateDefinition =
ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE to
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE]
.asJsonPrimitive()
- )
+ )
)
}
resolutionSummary -> {
// Comparision between what we have in the database vs what we have to assign.
private fun compareOne(resourceResolution: ResourceResolution, resourceAssignment: ResourceAssignment): Boolean {
- return (resourceResolution.name == resourceAssignment.name &&
- resourceResolution.dictionaryName == resourceAssignment.dictionaryName &&
- resourceResolution.dictionarySource == resourceAssignment.dictionarySource &&
- resourceResolution.dictionaryVersion == resourceAssignment.version)
+ return (
+ resourceResolution.name == resourceAssignment.name &&
+ resourceResolution.dictionaryName == resourceAssignment.dictionaryName &&
+ resourceResolution.dictionarySource == resourceAssignment.dictionarySource &&
+ resourceResolution.dictionaryVersion == resourceAssignment.version
+ )
}
private fun exposeOccurrencePropertyInResourceAssignments(
) {
class PropertiesBuilder : PropertiesAssignmentBuilder() {
+
fun type(type: String) = type(type.asJsonPrimitive())
fun type(type: JsonNode) {
}
class KeyMappingBuilder() {
+
val map: MutableMap<String, String> = hashMapOf()
fun map(key: String, value: String) {
map[key] = value
) {
class PropertiesBuilder : PropertiesAssignmentBuilder() {
+
fun type(type: String) = type(type.asJsonPrimitive())
fun type(type: JsonNode) {
) {
class PropertiesBuilder : PropertiesAssignmentBuilder() {
+
fun type(type: String) = type(type.asJsonPrimitive())
fun type(type: JsonNode) {
open class ResourceSourceProperties
open class InputResourceSource : ResourceSourceProperties() {
+
lateinit var key: String
+
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
open class DefaultResourceSource : ResourceSourceProperties() {
+
lateinit var key: String
+
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
open class DatabaseResourceSource : ResourceSourceProperties() {
+
lateinit var type: String
+
@get:JsonProperty("endpoint-selector")
var endpointSelector: String? = null
lateinit var query: String
+
@get:JsonProperty("input-key-mapping")
var inputKeyMapping: MutableMap<String, String>? = null
+
@get:JsonProperty("output-key-mapping")
var outputKeyMapping: MutableMap<String, String>? = null
+
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
open class RestResourceSource : ResourceSourceProperties() {
+
lateinit var verb: String
+
@get:JsonProperty("payload")
var payload: String? = null
+
@get:JsonProperty("resolved-payload")
var resolvedPayload: String? = null
lateinit var type: String
+
@get:JsonProperty("endpoint-selector")
var endpointSelector: String? = null
+
@get:JsonProperty("url-path")
lateinit var urlPath: String
lateinit var path: String
+
@get:JsonProperty("expression-type")
lateinit var expressionType: String
+
@get:JsonProperty("input-key-mapping")
var inputKeyMapping: MutableMap<String, String>? = null
+
@get:JsonProperty("output-key-mapping")
var outputKeyMapping: MutableMap<String, String>? = null
+
@get:JsonProperty("headers")
var headers: Map<String, String> = emptyMap()
+
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
open class CapabilityResourceSource : ResourceSourceProperties() {
+
@get:JsonProperty("script-type")
lateinit var scriptType: String
+
@get:JsonProperty("script-class-reference")
lateinit var scriptClassReference: String
+
@get:JsonProperty("instance-dependencies")
var instanceDependencies: List<String>? = null
+
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
/** Generates aggregated request payload for Ip Assign mS. Parses the resourceassignments of
* sourceCapability "ipassign-ms". It generates below sample payload
* {
- "requests": [{
- "name": "fixed_ipv4_Address_01",
- "property": {
- "CloudRegionId": "abcd123",
- "IpServiceName": "MobilityPlan",
- }
- }, {
- "name": "fixed_ipv4_Address_02",
- "property": {
- "CloudRegionId": "abcd123",
- "IpServiceName": "MobilityPlan",
- }
- }
- ]
- } */
+ "requests": [{
+ "name": "fixed_ipv4_Address_01",
+ "property": {
+ "CloudRegionId": "abcd123",
+ "IpServiceName": "MobilityPlan",
+ }
+ }, {
+ "name": "fixed_ipv4_Address_02",
+ "property": {
+ "CloudRegionId": "abcd123",
+ "IpServiceName": "MobilityPlan",
+ }
+ }
+ ]
+ } */
private fun generatePayload(
input: Map<String, Any>,
groupResourceAssignments: MutableList<ResourceAssignment>
* sourceCapability "naming-ms". "naming-type" should be provides as property metadata for
* each resourceassigment of sourceCapability "naming-ms". It generates below sample payload
* {
- "elements": [{
- "vf-module-name": "${vf-module-name}",
- "naming-type": "VF-MODULE",
- "naming-code": "dbc",
- "vf-module-label": "adsf",
- "policy-instance-name": "SDNC_Policy.Config_Json.xml",
- "vnf-name": "vnf-123",
- "vf-module-type": "base"
- }, {
- "vnfc-name": "${vnfc-name}",
- "naming-type": "VNFC",
- "naming-code": "dbc",
- "vf-module-label": "adsf",
- "policy-instance-name": "SDNC_Policy.Config_Json.xml",
- "vnf-name": "vnf-123",
- "vf-module-type": "base"
- }
- ]
- } */
+ "elements": [{
+ "vf-module-name": "${vf-module-name}",
+ "naming-type": "VF-MODULE",
+ "naming-code": "dbc",
+ "vf-module-label": "adsf",
+ "policy-instance-name": "SDNC_Policy.Config_Json.xml",
+ "vnf-name": "vnf-123",
+ "vf-module-type": "base"
+ }, {
+ "vnfc-name": "${vnfc-name}",
+ "naming-type": "VNFC",
+ "naming-code": "dbc",
+ "vf-module-label": "adsf",
+ "policy-instance-name": "SDNC_Policy.Config_Json.xml",
+ "vnf-name": "vnf-123",
+ "vf-module-type": "base"
+ }
+ ]
+ } */
private fun generatePayload(
input: Map<String, Any>,
groupResourceAssignments: MutableList<ResourceAssignment>
val moduleValue = "\${".plus(moduleName.plus("}"))
val request: MutableMap<String, String> = input.mapValues {
- it.value.toString().removeSurrounding("\"") } as MutableMap<String, String>
+ it.value.toString().removeSurrounding("\"")
+ } as MutableMap<String, String>
if (namingType != null) {
request["naming-type"] = namingType
}
var createdDate = Date()
companion object {
+
private const val serialVersionUID = 1L
}
}
resolutionKey: String
) {
resourceResolutionRepository.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(
- blueprintName,
- blueprintVersion,
- artifactName,
- resolutionKey
+ blueprintName,
+ blueprintVersion,
+ artifactName,
+ resolutionKey
)
}
}
var createdDate = Date()
companion object {
+
private const val serialVersionUID = 1L
}
}
)?.let {
log.info(
"Overwriting template resolution for blueprintName=($blueprintVersion), blueprintVersion=($blueprintName), " +
- "artifactName=($artifactPrefix) and resolutionKey=($resolutionKey)"
+ "artifactName=($artifactPrefix) and resolutionKey=($resolutionKey)"
)
templateResolutionRepository.deleteByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactNameAndOccurrence(
resolutionKey,
)?.let {
log.info(
"Overwriting template resolution for blueprintName=($blueprintVersion), blueprintVersion=($blueprintName), " +
- "artifactName=($artifactPrefix), resourceId=($resourceId) and resourceType=($resourceType)"
+ "artifactName=($artifactPrefix), resourceId=($resourceId) and resourceType=($resourceType)"
)
templateResolutionRepository.deleteByResourceIdAndResourceTypeAndBlueprintNameAndBlueprintVersionAndArtifactNameAndOccurrence(
resourceId,
try {
log.info(
"Writing out template_resolution result: bpName: $blueprintName bpVer $blueprintVersion resKey:$resolutionKey" +
- " (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence"
+ " (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence"
)
templateResolutionRepository.saveAndFlush(resourceResolutionResult)
} catch (ex: DataIntegrityViolationException) {
log.error(
"Error writing out template_resolution result: bpName: $blueprintName bpVer $blueprintVersion resKey:$resolutionKey" +
- " (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence error: {}", ex.message
+ " (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence error: {}",
+ ex.message
)
throw BluePrintException("Failed to store resource api result.", ex)
}
suspend fun scriptInstance(scriptType: String, scriptClassReference: String, instanceDependencies: List<String>):
ResourceAssignmentProcessor {
- log.info("creating resource resolution of script type($scriptType), reference name($scriptClassReference)")
+ log.info("creating resource resolution of script type($scriptType), reference name($scriptClassReference)")
- val scriptComponent = componentFunctionScriptingService
- .scriptInstance<ResourceAssignmentProcessor>(
- raRuntimeService.bluePrintContext(), scriptType,
- scriptClassReference
- )
+ val scriptComponent = componentFunctionScriptingService
+ .scriptInstance<ResourceAssignmentProcessor>(
+ raRuntimeService.bluePrintContext(), scriptType,
+ scriptClassReference
+ )
- return scriptComponent
- }
+ return scriptComponent
+ }
}
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor
import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService
+import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
+import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process Database resource resolution in template key ($resourceAssignment) assignments."
- throw e.updateErrorMessage(ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
- "Wrong resource definition or DB resolution failed.")
+ throw e.updateErrorMessage(
+ ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
+ "Wrong resource definition or DB resolution failed."
+ )
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
}
sourceProperties.inputKeyMapping
- ?.mapValues { raRuntimeService.getDictionaryStore(it.value) }
- ?.map { KeyIdentifier(it.key, it.value) }
- ?.let { resourceAssignment.keyIdentifiers.addAll(it) }
+ ?.mapValues { raRuntimeService.getResolutionStore(it.value) }
+ ?.map { KeyIdentifier(it.key, it.value) }
+ ?.let { resourceAssignment.keyIdentifiers.addAll(it) }
logger.info(
"DatabaseResource ($dSource) dictionary information: " +
- "Query:($sql), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})"
+ "Query:($sql), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})"
)
val jdbcTemplate = blueprintDBLibService(sourceProperties, dSource)
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process default resource resolution in template key ($resourceAssignment) assignments."
- throw e.updateErrorMessage(ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
- "Wrong default value was set.")
+ throw e.updateErrorMessage(
+ ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
+ "Wrong default value was set."
+ )
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process input resource resolution in template key ($resourceAssignment) assignments."
- throw e.updateErrorMessage(ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
- "Wrong input value was set.")
+ throw e.updateErrorMessage(
+ ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
+ "Wrong input value was set."
+ )
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with : (${e.message})", e)
open suspend fun resolveFromInputKeyMapping(valueToResolve: String, keyMapping: MutableMap<String, JsonNode>):
String {
- if (valueToResolve.isEmpty() || !valueToResolve.contains("$")) {
- return valueToResolve
+ if (valueToResolve.isEmpty() || !valueToResolve.contains("$")) {
+ return valueToResolve
+ }
+ // TODO("Optimize to JSON Node directly without velocity").asJsonNode().toString()
+ return BluePrintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString())
}
- // TODO("Optimize to JSON Node directly without velocity").asJsonNode().toString()
- return BluePrintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString())
- }
final override suspend fun applyNB(resourceAssignment: ResourceAssignment): Boolean {
try {
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
+import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
checkNotNull(sourceProperties.inputKeyMapping) { "failed to get input-key-mappings for $dName under $dSource properties" }
val resolvedInputKeyMapping = resolveInputKeyMappingVariables(inputKeyMapping).toMutableMap()
- inputKeyMapping?.mapValues { raRuntimeService.getDictionaryStore(it.value) }
- ?.map { KeyIdentifier(it.key, it.value) }
- ?.let { resourceAssignment.keyIdentifiers.addAll(it) }
+ resolvedInputKeyMapping.map { KeyIdentifier(it.key, it.value) }.let {
+ resourceAssignment.keyIdentifiers.addAll(it)
+ }
// Resolving content Variables
val payload = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.payload), resolvedInputKeyMapping)
logger.info(
"RestResource ($dSource) dictionary information: " +
- "URL:($urlPath), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})"
+ "URL:($urlPath), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})"
)
val requestHeaders = sourceProperties.headers
logger.info("$dSource dictionary information : ($urlPath), ($inputKeyMapping), (${sourceProperties.outputKeyMapping})")
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process REST resource resolution in template key ($resourceAssignment) assignments."
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, errorMsg)
- throw e.updateErrorMessage(ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
- "Wrong resource definition or resolution failed.")
+ throw e.updateErrorMessage(
+ ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
+ "Wrong resource definition or resolution failed."
+ )
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
resourceAssignment.dictionaryName = resourceAssignment.name
logger.warn(
"Missing dictionary key, setting with template key (${resourceAssignment.name}) " +
- "as dictionary key (${resourceAssignment.dictionaryName})"
+ "as dictionary key (${resourceAssignment.dictionaryName})"
)
}
val valueToPrint = getValueToLog(metadata, value)
logger.info(
"Setting Resource Value ($valueToPrint) for Resource Name " +
- "(${resourceAssignment.name}), definition(${resourceAssignment.dictionaryName}) " +
- "of type (${resourceProp.type})"
+ "(${resourceAssignment.name}), definition(${resourceAssignment.dictionaryName}) " +
+ "of type (${resourceProp.type})"
)
setResourceValue(resourceAssignment, raRuntimeService, value)
resourceAssignment.updatedDate = Date()
} catch (e: Exception) {
throw BluePrintProcessorException(
"Failed in setting value for template key " +
- "(${resourceAssignment.name}) and dictionary key (${resourceAssignment.dictionaryName}) of " +
- "type (${resourceProp.type}) with error message (${e.message})", e
+ "(${resourceAssignment.name}) and dictionary key (${resourceAssignment.dictionaryName}) of " +
+ "type (${resourceProp.type}) with error message (${e.message})",
+ e
)
}
}
val metadata = resourceAssignment.property?.metadata
metadata?.get(ResourceResolutionConstants.METADATA_TRANSFORM_TEMPLATE)
- ?.let { if (it.contains("$")) it else null }
- ?.let { template ->
- val resolutionStore = raRuntimeService.getResolutionStore()
- .mapValues { e -> e.value.asText() } as MutableMap<String, Any>
- val newValue: JsonNode
- try {
- newValue = BluePrintVelocityTemplateService
- .generateContent(template, null, true, resolutionStore)
- .also { if (hasLogProtect(metadata))
- logger.info("Transformed value: $resourceAssignment.name")
- else
- logger.info("Transformed value: $value -> $it") }
- .let { v -> v.asJsonType() }
- } catch (e: Exception) {
- throw BluePrintProcessorException(
- "transform-template failed: $template", e)
- }
- with(resourceAssignment) {
- raRuntimeService.putResolutionStore(this.name, newValue)
- raRuntimeService.putDictionaryStore(this.dictionaryName!!, newValue)
- this.property!!.value = newValue
- }
+ ?.let { if (it.contains("$")) it else null }
+ ?.let { template ->
+ val resolutionStore = raRuntimeService.getResolutionStore()
+ .mapValues { e -> e.value.asText() } as MutableMap<String, Any>
+ val newValue: JsonNode
+ try {
+ newValue = BluePrintVelocityTemplateService
+ .generateContent(template, null, true, resolutionStore)
+ .also {
+ if (hasLogProtect(metadata))
+ logger.info("Transformed value: $resourceAssignment.name")
+ else
+ logger.info("Transformed value: $value -> $it")
+ }
+ .let { v -> v.asJsonType() }
+ } catch (e: Exception) {
+ throw BluePrintProcessorException(
+ "transform-template failed: $template", e
+ )
}
+ with(resourceAssignment) {
+ raRuntimeService.putResolutionStore(this.name, newValue)
+ raRuntimeService.putDictionaryStore(this.dictionaryName!!, newValue)
+ this.property!!.value = newValue
+ }
+ }
}
fun setFailedResourceDataValue(resourceAssignment: ResourceAssignment, message: String?) {
}
}
result = mapper.writerWithDefaultPrettyPrinter()
- .writeValueAsString(mapper.treeToValue(root, Object::class.java))
+ .writeValueAsString(mapper.treeToValue(root, Object::class.java))
if (!containsLogProtected) {
logger.info("Generated Resource Param Data ($result)")
val definition = resourceDefinitions[it.name]
val description = definition?.property?.description ?: ""
val value = it.property?.value
- ?.let { v -> if (v.isNullOrMissing()) emptyTextNode else v }
- ?: emptyTextNode
+ ?.let { v -> if (v.isNullOrMissing()) emptyTextNode else v }
+ ?: emptyTextNode
var payload: JsonNode = definition?.sources?.get(it.dictionarySource)
- ?.properties?.get("resolved-payload")
- ?.let { p -> if (p.isNullOrMissing()) emptyTextNode else p }
- ?: emptyTextNode
+ ?.properties?.get("resolved-payload")
+ ?.let { p -> if (p.isNullOrMissing()) emptyTextNode else p }
+ ?: emptyTextNode
val metadata = definition?.property?.metadata
- ?.map { e -> DictionaryMetadataEntry(e.key, e.value) }
- ?.toMutableList() ?: mutableListOf()
+ ?.map { e -> DictionaryMetadataEntry(e.key, e.value) }
+ ?.toMutableList() ?: mutableListOf()
val keyIdentifiers: MutableList<KeyIdentifier> = it.keyIdentifiers.map { k ->
if (k.value.isNullOrMissing()) KeyIdentifier(k.name, emptyTextNode) else k
}.toMutableList()
ResolutionSummary(
- it.name,
- value,
- it.property?.required ?: false,
- it.property?.type ?: "",
- keyIdentifiers,
- description,
- metadata,
- it.dictionaryName ?: "",
- it.dictionarySource ?: "",
- payload,
- it.status ?: "",
- it.message ?: ""
+ it.name,
+ value,
+ it.property?.required ?: false,
+ it.property?.type ?: "",
+ keyIdentifiers,
+ description,
+ metadata,
+ it.dictionaryName ?: "",
+ it.dictionarySource ?: "",
+ payload,
+ it.status ?: "",
+ it.message ?: ""
)
}
// Wrapper needed for integration with SDNC
if ((resourceAssignment.property?.entrySchema?.type).isNullOrEmpty()) {
throw BluePrintProcessorException(
"Couldn't get data type for dictionary type " +
- "(${resourceAssignment.property!!.type}) and dictionary name ($dName)"
+ "(${resourceAssignment.property!!.type}) and dictionary name ($dName)"
)
}
val entrySchemaType = resourceAssignment.property!!.entrySchema!!.type
val outputKeyMap = outputKeyMapping.entries.first()
if (resourceAssignment.keyIdentifiers.none { it.name == outputKeyMap.key }) {
resourceAssignment.keyIdentifiers.add(
- KeyIdentifier(outputKeyMap.key, JacksonUtils.objectMapper.createArrayNode())
+ KeyIdentifier(outputKeyMap.key, JacksonUtils.objectMapper.createArrayNode())
)
}
return parseSingleElementNodeWithOneOutputKeyMapping(
logKeyValueResolvedResource(metadata, outputKeyMappingKey, responseKeyValue, type)
JacksonUtils.populateJsonNodeValues(outputKeyMappingKey, responseKeyValue, type, arrayChildNode)
resourceAssignment.keyIdentifiers.find { it.name == outputKeyMappingKey && it.value.isArray }
- .let {
- if (it != null)
- (it.value as ArrayNode).add(responseKeyValue)
- else
- resourceAssignment.keyIdentifiers.add(
- KeyIdentifier(outputKeyMappingKey, responseKeyValue))
- }
+ .let {
+ if (it != null)
+ (it.value as ArrayNode).add(responseKeyValue)
+ else
+ resourceAssignment.keyIdentifiers.add(
+ KeyIdentifier(outputKeyMappingKey, responseKeyValue)
+ )
+ }
return arrayChildNode
}
logger.info(
"For List Type Resource: key ($key), value ($valueToPrint), " +
- "type ({$type})"
+ "type ({$type})"
)
}
}
fun getValueToLog(metadata: MutableMap<String, String>?, value: Any): Any =
- if (hasLogProtect(metadata)) LOG_REDACTED else value
+ if (hasLogProtect(metadata)) LOG_REDACTED else value
}
}
resolveDefinition: String,
sources: List<String>
):
- MutableList<ResourceAssignment> {
- /** Check if resolve definition is defined in the resource definition Map */
- val resourceDefinition = resourceDefinitions[resolveDefinition]
- ?: throw BluePrintProcessorException("failed to get resolve definition($resolveDefinition)")
+ MutableList<ResourceAssignment> {
+ /** Check if resolve definition is defined in the resource definition Map */
+ val resourceDefinition = resourceDefinitions[resolveDefinition]
+ ?: throw BluePrintProcessorException("failed to get resolve definition($resolveDefinition)")
- val resourceAssignments: MutableList<ResourceAssignment> = arrayListOf()
- /** Get the dependency property fields for the the resource definition to resolve */
- val definitionDependencies = definitionDependencies(resourceDefinition, sources)
- definitionDependencies.forEach { definitionDependencyName ->
- val definitionDependency = resourceDefinitions[definitionDependencyName]
- ?: throw BluePrintProcessorException("failed to get dependency definition($definitionDependencyName)")
+ val resourceAssignments: MutableList<ResourceAssignment> = arrayListOf()
- val resourceAssignment = ResourceAssignment().apply {
- name = definitionDependency.name
- dictionaryName = definitionDependency.name
- /** The assumption is al resource are already resolved and shall get as input source */
- dictionarySource = "input"
- property = definitionDependency.property
- }
- resourceAssignments.add(resourceAssignment)
- }
+ /** Get the dependency property fields for the the resource definition to resolve */
+ val definitionDependencies = definitionDependencies(resourceDefinition, sources)
+ definitionDependencies.forEach { definitionDependencyName ->
+ val definitionDependency = resourceDefinitions[definitionDependencyName]
+ ?: throw BluePrintProcessorException("failed to get dependency definition($definitionDependencyName)")
- resourceDefinition.sources.forEach { (sourceName, source) ->
- if (sources.contains(sourceName)) {
val resourceAssignment = ResourceAssignment().apply {
- name = "$sourceName:${resourceDefinition.name}"
- dictionaryName = resourceDefinition.name
- dictionarySource = sourceName
- dictionarySourceDefinition = source
- // Clone the PropertyDefinition, otherwise property value will be overridden
- property = JacksonUtils
- .readValue(resourceDefinition.property.asJsonString(), PropertyDefinition::class.java)
- val keyDependenciesExists = source.properties?.containsKey("key-dependencies") ?: false
- if (keyDependenciesExists) {
- dependencies = source.properties!!["key-dependencies"]!!.asListOfString().toMutableList()
- }
+ name = definitionDependency.name
+ dictionaryName = definitionDependency.name
+ /** The assumption is al resource are already resolved and shall get as input source */
+ dictionarySource = "input"
+ property = definitionDependency.property
}
resourceAssignments.add(resourceAssignment)
}
+
+ resourceDefinition.sources.forEach { (sourceName, source) ->
+ if (sources.contains(sourceName)) {
+ val resourceAssignment = ResourceAssignment().apply {
+ name = "$sourceName:${resourceDefinition.name}"
+ dictionaryName = resourceDefinition.name
+ dictionarySource = sourceName
+ dictionarySourceDefinition = source
+ // Clone the PropertyDefinition, otherwise property value will be overridden
+ property = JacksonUtils
+ .readValue(resourceDefinition.property.asJsonString(), PropertyDefinition::class.java)
+ val keyDependenciesExists = source.properties?.containsKey("key-dependencies") ?: false
+ if (keyDependenciesExists) {
+ dependencies = source.properties!!["key-dependencies"]!!.asListOfString().toMutableList()
+ }
+ }
+ resourceAssignments.add(resourceAssignment)
+ }
+ }
+ // Populate Resource Definition's dependencies as Input Resource Assignment
+ return resourceAssignments
}
- // Populate Resource Definition's dependencies as Input Resource Assignment
- return resourceAssignments
- }
}
"prop1" : "1234",
"prop2" : true,
"prop3" : 23
- }""".trimIndent()
+ }
+ """.trimIndent()
)
}
outputs {
"source-input", "source-default", "source-db",
"source-rest", "source-capability"
)
- ), "failed to get registered sources : $sources"
+ ),
+ "failed to get registered sources : $sources"
)
}
assertEquals("This is Sample Velocity Template", templateMap)
val expectedAssignmentMap = hashMapOf(
- "service-instance-id" to "siid_1234",
- "vnf-id" to "vnf_1234",
- "vnf_name" to "temp_vnf"
+ "service-instance-id" to "siid_1234",
+ "vnf-id" to "vnf_1234",
+ "vnf_name" to "temp_vnf"
).asJsonType()
assertEquals(expectedAssignmentMap, assignmentMap)
}
"resource-assignment",
artifactPrefix,
props
- ), "Couldn't Resolve Resources for artifact $artifactPrefix"
+ ),
+ "Couldn't Resolve Resources for artifact $artifactPrefix"
)
}
}
Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
- "1234",
- "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
+ "1234",
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
val executionServiceInput =
- JacksonUtils.readValueFromClassPathFile(
- "payload/requests/sample-resourceresolution-request.json",
- ExecutionServiceInput::class.java
- )!!
+ JacksonUtils.readValueFromClassPathFile(
+ "payload/requests/sample-resourceresolution-request.json",
+ ExecutionServiceInput::class.java
+ )!!
val resourceAssignmentRuntimeService =
- ResourceAssignmentUtils.transformToRARuntimeService(
- bluePrintRuntimeService,
- "testResolveResourcesWithMappingAndTemplate"
- )
+ ResourceAssignmentUtils.transformToRARuntimeService(
+ bluePrintRuntimeService,
+ "testResolveResourcesWithMappingAndTemplate"
+ )
val artifactPrefix = "notemplate"
// Prepare Inputs
PayloadUtils.prepareInputsFromWorkflowPayload(
- bluePrintRuntimeService,
- executionServiceInput.payload,
- "resource-assignment"
+ bluePrintRuntimeService,
+ executionServiceInput.payload,
+ "resource-assignment"
)
resourceResolutionService.resolveResources(
- resourceAssignmentRuntimeService,
- "resource-assignment",
- artifactPrefix,
- props
+ resourceAssignmentRuntimeService,
+ "resource-assignment",
+ artifactPrefix,
+ props
)
}.let {
val summaries = JacksonUtils.jsonNode(it.first)["resolution-summary"]
Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
- "1234",
- "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
+ "1234",
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
val executionServiceInput =
- JacksonUtils.readValueFromClassPathFile(
- "payload/requests/sample-resourceresolution-request.json",
- ExecutionServiceInput::class.java
- )!!
+ JacksonUtils.readValueFromClassPathFile(
+ "payload/requests/sample-resourceresolution-request.json",
+ ExecutionServiceInput::class.java
+ )!!
val resourceAssignmentRuntimeService =
- ResourceAssignmentUtils.transformToRARuntimeService(
- bluePrintRuntimeService,
- "testResolveResourcesWithMappingAndTemplate"
- )
+ ResourceAssignmentUtils.transformToRARuntimeService(
+ bluePrintRuntimeService,
+ "testResolveResourcesWithMappingAndTemplate"
+ )
// Prepare Inputs
PayloadUtils.prepareInputsFromWorkflowPayload(
- bluePrintRuntimeService,
- executionServiceInput.payload,
- "resource-assignment"
+ bluePrintRuntimeService,
+ executionServiceInput.payload,
+ "resource-assignment"
)
resourceResolutionService.resolveResources(
- resourceAssignmentRuntimeService,
- "resource-assignment",
- artifactPrefix,
- props
+ resourceAssignmentRuntimeService,
+ "resource-assignment",
+ artifactPrefix,
+ props
)
}.let {
- assertEquals("""
+ assertEquals(
+ """
{
"service-instance-id" : "siid_1234",
"vnf-id" : "vnf_1234",
"vnf_name" : "temp_vnf"
}
- """.trimIndent(), it.first)
+ """.trimIndent(),
+ it.first
+ )
assertEquals("siid_1234", it.second["service-instance-id"].asText())
}
}
"resource-assignment",
artifactPrefix,
props
- ), "Couldn't Resolve Resources for artifact $artifactPrefix"
+ ),
+ "Couldn't Resolve Resources for artifact $artifactPrefix"
)
}
}
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution",
- "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"],
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution",
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
*/
class IpAssignResolutionCapabilityTest {
+
val log = logger(IpAssignResolutionCapabilityTest::class)
@Before
val blueprintWebClientService = mockk<BlueprintWebClientService>()
// Create mock Response
val mockResponse = BlueprintWebClientService.WebClientResponse(
- 200, """{
+ 200,
+ """{
"fixed_ipv4_Address_01" : "10.10.10.11",
"fixed_ipv4_Address_02" : "10.10.10.12",
"fixed_ipv4_Address_03" : "10.10.10.13"
)
val resoulutionSummary =
- ResourceAssignmentUtils.generateResolutionSummaryData(resourceAssignments.values.toList(),
- capabilityResourceResolutionProcessor.resourceDictionaries)
+ ResourceAssignmentUtils.generateResolutionSummaryData(
+ resourceAssignments.values.toList(),
+ capabilityResourceResolutionProcessor.resourceDictionaries
+ )
log.info(resoulutionSummary.asJsonType().toPrettyString())
assertNotNull(resoulutionSummary.asJsonType().get("resolution-summary"))
}
}
- /** Test dictionaries */
+ /** Test dictionaries */
/** Test dictionaries */
private fun resourceDefinitions(): MutableMap<String, ResourceDefinition> {
val blueprintWebClientService = mockk<BlueprintWebClientService>()
// Create mock Response
val mockResponse = BlueprintWebClientService.WebClientResponse<String>(
- 200, """{
+ 200,
+ """{
"vf-module-name" : "dlsst001dbcx-adsf-Base-01",
"vnfc-name" : "dlsst001dbcx"
}
)
val resoulutionSummary =
- ResourceAssignmentUtils.generateResolutionSummaryData(resourceAssignments.values.toList(),
- capabilityResourceResolutionProcessor.resourceDictionaries)
+ ResourceAssignmentUtils.generateResolutionSummaryData(
+ resourceAssignments.values.toList(),
+ capabilityResourceResolutionProcessor.resourceDictionaries
+ )
log.info(resoulutionSummary.asJsonType().toPrettyString())
assertNotNull(resoulutionSummary.asJsonType().get("resolution-summary"))
} returns ResourceResolution()
runBlocking {
resourceResolutionDBService.write(
- props, bluePrintRuntimeService, artifactPrefix, resourceAssignment
- )
+ props, bluePrintRuntimeService, artifactPrefix, resourceAssignment
+ )
val res = slot.captured
} returns Unit
runBlocking {
val res = resourceResolutionDBService.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(
- blueprintName, blueprintVersion, artifactPrefix, resolutionKey)
+ blueprintName, blueprintVersion, artifactPrefix, resolutionKey
+ )
assertEquals(Unit, res)
}
}
fun mockBlueprintWebClientService(selector: String):
MockBlueprintWebClientService {
- val prefix = "blueprintsprocessor.restclient.$selector"
- val restClientProperties = restClientProperties(prefix)
- return mockBlueprintWebClientService(restClientProperties)
- }
+ val prefix = "blueprintsprocessor.restclient.$selector"
+ val restClientProperties = restClientProperties(prefix)
+ return mockBlueprintWebClientService(restClientProperties)
+ }
private fun mockBlueprintWebClientService(restClientProperties: RestClientProperties):
MockBlueprintWebClientService {
- return MockBlueprintWebClientService(restClientProperties)
- }
+ return MockBlueprintWebClientService(restClientProperties)
+ }
}
class MockBlueprintWebClientService(private var restClientProperties: RestClientProperties) :
BlueprintWebClientService {
+
private var mockServer: ClientAndServer
private var port: String = if (restClientProperties.url.split(":")[2].isEmpty()) "8080"
else restClientProperties.url.split(":")[2]
// Create expected requests and responses
setRequest("GET", "/aai/v14/network/generic-vnfs/generic-vnf/123456")
setRequest(
- "GET", "/config/GENERIC-RESOURCE-API:services/service/10/service-data/vnfs/vnf/123456/" +
+ "GET",
+ "/config/GENERIC-RESOURCE-API:services/service/10/service-data/vnfs/vnf/123456/" +
"vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name"
)
setRequestWithPayload(
class MockRestResourceResolutionProcessor(
private val blueprintRestLibPropertyService:
- MockBluePrintRestLibPropertyService
+ MockBluePrintRestLibPropertyService
) : ResourceAssignmentProcessor() {
private val logger = LoggerFactory.getLogger(MockRestResourceResolutionProcessor::class.java)
open class MockCapabilityService
open class MockCapabilityScriptRA : ResourceAssignmentProcessor() {
+
val log = logger(MockCapabilityScriptRA::class)
override fun getName(): String {
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [TestDatabaseConfiguration::class,
+ classes = [
+ TestDatabaseConfiguration::class,
PrimaryDBLibGenericService::class, BluePrintDBLibPropertyService::class,
DatabaseResourceAssignmentProcessor::class, MockDBLibGenericService::class,
- MockBlueprintProcessorCatalogServiceImpl::class]
+ MockBlueprintProcessorCatalogServiceImpl::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class DatabaseResourceResolutionProcessorTest {
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [MockRestResourceResolutionProcessor::class, MockBluePrintRestLibPropertyService::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, RestClientProperties::class]
+ classes = [
+ MockRestResourceResolutionProcessor::class, MockBluePrintRestLibPropertyService::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, RestClientProperties::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class RestResourceResolutionProcessorTest {
data class ExpectedResponseIpAddress(val ipAddress: IpAddress)
class ResourceAssignmentUtilsTest {
+
private lateinit var resourceAssignmentRuntimeService: ResourceAssignmentRuntimeService
private lateinit var resourceAssignment: ResourceAssignment
}
val result = ResourceAssignmentUtils.generateResolutionSummaryData(
- listOf(resourceAssignment), mapOf("pnf-id" to resourceDefinition))
+ listOf(resourceAssignment), mapOf("pnf-id" to resourceDefinition)
+ )
- assertEquals("""
+ assertEquals(
+ """
{
"resolution-summary":[
{
}
]
}
- """.replace("\n|\\s".toRegex(), ""), result)
+ """.replace("\n|\\s".toRegex(), ""),
+ result
+ )
}
private fun createResourceAssignmentForTest(resourceValue: String?, resourceName: String = "pnf-id"): ResourceAssignment {
"Unexpected outcome returned for primitive type of key-value String"
)
assertEquals(
- expectedValueToTestPrimitiveType,
- resourceAssignment.keyIdentifiers[0].value
+ expectedValueToTestPrimitiveType,
+ resourceAssignment.keyIdentifiers[0].value
)
}
val expectedKeyIdentifierValue = JacksonUtils.getJsonNode(outcome.map { it["ip"] })
assertEquals(
- expectedKeyIdentifierValue,
- resourceAssignment.keyIdentifiers[0].value
+ expectedKeyIdentifierValue,
+ resourceAssignment.keyIdentifiers[0].value
)
// FIXME("Map is not collection type, It is known complex type")
"Unexpected outcome returned for complex type"
)
assertEquals(
- expectedValueToTestComplexTypeWithOneOutputKeyMapping["host"],
- resourceAssignment.keyIdentifiers[0].value)
+ expectedValueToTestComplexTypeWithOneOutputKeyMapping["host"],
+ resourceAssignment.keyIdentifiers[0].value
+ )
}
@Test
)
assertEquals(2, resourceAssignment.keyIdentifiers.size)
assertEquals(
- expectedValueToTestComplexTypeWithAllOutputKeyMapping["name"],
- resourceAssignment.keyIdentifiers[0].value
+ expectedValueToTestComplexTypeWithAllOutputKeyMapping["name"],
+ resourceAssignment.keyIdentifiers[0].value
)
assertEquals(
- expectedValueToTestComplexTypeWithAllOutputKeyMapping["ipAddress"],
- resourceAssignment.keyIdentifiers[1].value
+ expectedValueToTestComplexTypeWithAllOutputKeyMapping["ipAddress"],
+ resourceAssignment.keyIdentifiers[1].value
)
}
// Enable transform template
resourceAssignment.property!!.metadata =
- mutableMapOf(METADATA_TRANSFORM_TEMPLATE to "\${vnf_name}_private2")
+ mutableMapOf(METADATA_TRANSFORM_TEMPLATE to "\${vnf_name}_private2")
ResourceAssignmentUtils
- .setResourceDataValue(resourceAssignment, resourceAssignmentRuntimeService, value)
+ .setResourceDataValue(resourceAssignment, resourceAssignmentRuntimeService, value)
- assertEquals("abc-vnf_private2",
- resourceAssignment.property!!.value!!.asText())
+ assertEquals(
+ "abc-vnf_private2",
+ resourceAssignment.property!!.value!!.asText()
+ )
}
private fun initInputMapAndExpectedValuesForPrimitiveType() {
expectedValueToTestCollectionOfComplexTypeWithOneOutputKeyMapping = arrayListOf(
ExpectedResponseIpAddress(IpAddress("1111", "1.2.3.1")),
- ExpectedResponseIpAddress(IpAddress("2222", "1.2.3.2")), ExpectedResponseIpAddress(
+ ExpectedResponseIpAddress(IpAddress("2222", "1.2.3.2")),
+ ExpectedResponseIpAddress(
IpAddress("3333", "1.2.3.3")
)
).asJsonType()
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>restconf-executor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <name>Blueprints Processor Function - Restconf Executor</name>
+ <name>MS Blueprints Processor Functions - Restconf Executor</name>
<description>Blueprints Processor Function - Restconf Executor</description>
<dependencies>
log.debug("headers: $additionalHeaders")
log.info("configuring device: $deviceId, Configlet: $configletToApply")
val applyConfigUrl = "/restconf/config/network-topology:network-topology/topology/topology-netconf/node/" +
- "$deviceId/$configletResourcePath"
+ "$deviceId/$configletResourcePath"
return webClientService.exchangeResource("PATCH", applyConfigUrl, configletToApply as String, additionalHeaders)
}
deviceId: String,
configletResourcePath: String
):
- BlueprintWebClientService.WebClientResponse<String> {
+ BlueprintWebClientService.WebClientResponse<String> {
- val configPathUrl = "/restconf/config/network-topology:network-topology/topology/topology-netconf/node/" +
+ val configPathUrl = "/restconf/config/network-topology:network-topology/topology/topology-netconf/node/" +
"$deviceId/$configletResourcePath"
- log.debug("sending GET request, url: $configPathUrl")
- return webClientService.exchangeResource("GET", configPathUrl, "")
-}
+ log.debug("sending GET request, url: $configPathUrl")
+ return webClientService.exchangeResource("GET", configPathUrl, "")
+ }
/**
* Generic UnMount function
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>functions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-functions</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
<artifactId>restful-executor</artifactId>
- <name>Blueprints Processor Function - NRM Restful executor</name>
+ <name>MS Blueprints Processor Functions - NRM Restful executor</name>
<description>Blueprints Processor Function - NRM Restful executor</description>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>processor-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>processor-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
lateinit var scriptComponent: RestfulCMComponentFunction
companion object {
+
const val SCRIPT_TYPE = "script-type"
const val SCRIPT_CLASS_REFERENCE = "script-class-reference"
const val INSTANCE_DEPENDENCIES = "instance-dependencies"
* Populate the Script Instance based on the Type
*/
scriptComponent = componentFunctionScriptingService
- .scriptInstance<RestfulCMComponentFunction>(this, scriptType,
- scriptClassReference, scriptDependencies)
+ .scriptInstance<RestfulCMComponentFunction>(
+ this, scriptType,
+ scriptClassReference, scriptDependencies
+ )
checkNotNull(scriptComponent) { "failed to get restfulCM script component" }
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
bluePrintRuntimeService.getBluePrintError()
- .addError("Failed in ComponentRestfulExecutor : ${runtimeException.message}")
+ .addError("Failed in ComponentRestfulExecutor : ${runtimeException.message}")
}
}
*/
package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor
-import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
-import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.databind.node.ArrayNode
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import com.fasterxml.jackson.databind.node.ObjectNode
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction.RestfulNRMServiceClient
import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction.RestfulNRMServiceClient
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
abstract class RestfulCMComponentFunction : AbstractScriptComponentFunction() {
}
open fun bluePrintRestLibPropertyService(): BluePrintRestLibPropertyService =
- functionDependencyInstanceAsType(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY)
+ functionDependencyInstanceAsType(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY)
fun restClientService(clientInfo: JsonNode): BlueprintWebClientService {
return bluePrintRestLibPropertyService().blueprintWebClientService(clientInfo)
}
}
"config-delete" -> {
- for (managed_object_instance in managed_object_instances) {
+ for (managed_object_instance in managed_object_instances) {
// invoke deleteMOI for each managed-object-instance
log.info("invoke deleteMOI for each managed-object-instance")
var NRM_Restful_client = RestfulNRMServiceClient()
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ObjectNode
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.springframework.http.HttpMethod
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import java.util.UUID
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import org.springframework.http.HttpMethod
import org.springframework.web.util.UriComponentsBuilder
+import java.util.UUID
class RestfulNRMServiceClient() {
package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction
import com.fasterxml.jackson.databind.node.ObjectNode
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
-import org.junit.Test
import org.junit.Ignore
-import org.springframework.beans.factory.annotation.Autowired
+import org.junit.Test
import org.junit.runner.RunWith
-import org.springframework.test.context.junit4.SpringRunner
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.BluePrintRestLibConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.http.HttpStatus
+import org.springframework.http.ResponseEntity
import org.springframework.test.context.ContextConfiguration
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.BluePrintRestLibConfiguration
import org.springframework.test.context.TestPropertySource
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
-import kotlin.test.assertNotNull
-import kotlin.test.assertEquals
-import org.springframework.web.bind.annotation.RestController
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.PutMapping
+import org.springframework.test.context.junit4.SpringRunner
+import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PatchMapping
-import org.springframework.web.bind.annotation.DeleteMapping
-import org.springframework.http.ResponseEntity
-import org.springframework.http.HttpStatus
+import org.springframework.web.bind.annotation.PutMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import kotlin.test.assertEquals
+import kotlin.test.assertNotNull
@RunWith(SpringRunner::class)
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextConfiguration(classes = [BluePrintRestLibConfiguration::class, NrmTestController::class])
-@TestPropertySource(properties = [
- "blueprintsprocessor.restclient.nrm.type=basic-auth",
- "blueprintsprocessor.restclient.nrm.url=http://127.0.0.1:8080",
- "blueprintsprocessor.restclient.nrm.username=admin",
- "blueprintsprocessor.restclient.nrm.password=admin"
-])
+@TestPropertySource(
+ properties = [
+ "blueprintsprocessor.restclient.nrm.type=basic-auth",
+ "blueprintsprocessor.restclient.nrm.url=http://127.0.0.1:8080",
+ "blueprintsprocessor.restclient.nrm.username=admin",
+ "blueprintsprocessor.restclient.nrm.password=admin"
+ ]
+)
@Ignore
class RestfulNRMServiceClientTest {
test_moi_data.put("data", test_attributes_data)
val response = restfulNRMServiceClient.modifyMOIAttributes(restClientService, idStr, test_moi_data)
assertNotNull(response, "failed to get modifyMOIAttributes response")
- assertEquals("Modify MOI object attributes successfully", response.get("body").get("data").toString(), "failed to get modifyMOIAttributes response")
+ assertEquals(
+ "Modify MOI object attributes successfully",
+ response.get("body").get("data").toString(),
+ "failed to get modifyMOIAttributes response"
+ )
}
@Test
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprints</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>modules-blueprints</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-core</artifactId>
- <name>Controller Blueprints Core</name>
+ <name>MS Blueprints Processor Modules - Blueprints - Blueprints Core</name>
<dependencies>
<!-- Compiler Service -->
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-script-runtime</artifactId>
</dependency>
-
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
const val MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO = "tosca.relationships.ConnectsTo"
const val MODEL_TYPE_RELATIONSHIPS_ATTACH_TO = "tosca.relationships.AttachesTo"
const val MODEL_TYPE_RELATIONSHIPS_ROUTES_TO = "tosca.relationships.RoutesTo"
+
// CDS Defined Relationship Types
const val MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB = "tosca.relationships.ConnectsTo.Db"
const val MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT = "tosca.relationships.ConnectsTo.RestClient"
const val MODEL_TYPE_CAPABILITY_TYPE_ATTACHMENT = "tosca.capabilities.Attachment"
const val MODEL_TYPE_CAPABILITY_TYPE_OPERATION_SYSTEM = "tosca.capabilities.OperatingSystem"
const val MODEL_TYPE_CAPABILITY_TYPE_BINDABLE = "tosca.capabilities.network.Bindable"
+
// Custom capabilities
const val MODEL_TYPE_CAPABILITY_TYPE_CONTENT = "tosca.capabilities.Content"
const val MODEL_TYPE_CAPABILITY_TYPE_MAPPING = "tosca.capabilities.Mapping"
const val MODEL_TYPE_CAPABILITY_TYPE_NETCONF = "tosca.capabilities.Netconf"
+ const val MODEL_TYPE_CAPABILITY_TYPE_RESTCONF = "tosca.capabilities.Restconf"
const val MODEL_TYPE_CAPABILITY_TYPE_SSH = "tosca.capabilities.Ssh"
const val MODEL_TYPE_CAPABILITY_TYPE_SFTP = "tosca.capabilities.Sftp"
package org.onap.ccsdk.cds.controllerblueprints.core
class BluePrintError {
+
var errors: MutableList<String> = arrayListOf()
fun addError(type: String, name: String, error: String) {
}
fun httpProcessorException(type: String, domain: String, message: String, cause: Throwable):
- BluePrintProcessorException {
- val bluePrintProcessorException = processorException(message, cause).http(type)
- return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
-}
+ BluePrintProcessorException {
+ val bluePrintProcessorException = processorException(message, cause).http(type)
+ return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
+ }
fun grpcProcessorException(type: String, domain: String, message: String, cause: Throwable):
- BluePrintProcessorException {
- val bluePrintProcessorException = processorException(message, cause).grpc(type)
- return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
-}
+ BluePrintProcessorException {
+ val bluePrintProcessorException = processorException(message, cause).grpc(type)
+ return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
+ }
fun httpProcessorException(type: String, domain: String, message: String, cause: Throwable, vararg args: Any?):
- BluePrintProcessorException {
- val bluePrintProcessorException = processorException(cause, message, args).http(type)
- return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
-}
+ BluePrintProcessorException {
+ val bluePrintProcessorException = processorException(cause, message, args).http(type)
+ return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
+ }
fun grpcProcessorException(type: String, domain: String, message: String, cause: Throwable, vararg args: Any?):
- BluePrintProcessorException {
- val bluePrintProcessorException = processorException(cause, message, args).grpc(type)
- return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
-}
+ BluePrintProcessorException {
+ val bluePrintProcessorException = processorException(cause, message, args).grpc(type)
+ return bluePrintProcessorException.addDomainAndErrorMessage(domain, message, ExceptionUtils.getRootCauseMessage(cause))
+ }
fun BluePrintProcessorException.updateErrorMessage(domain: String, message: String, cause: String):
- BluePrintProcessorException {
- return this.addDomainAndErrorMessage(domain, message, cause).domain(domain)
+ BluePrintProcessorException {
+ return this.addDomainAndErrorMessage(domain, message, cause).domain(domain)
.addErrorPayloadMessage(message)
.payloadMessage(message)
-}
+ }
fun BluePrintProcessorException.updateErrorMessage(domain: String, message: String): BluePrintProcessorException {
return this.addDomainAndErrorMessage(domain, message).domain(domain)
- .addErrorPayloadMessage(message)
- .payloadMessage(message)
+ .addErrorPayloadMessage(message)
+ .payloadMessage(message)
}
private fun BluePrintProcessorException.addDomainAndErrorMessage(
BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_CONTENT,
BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_MAPPING,
BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_NETCONF,
+ BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_RESTCONF,
BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_SSH,
BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_SFTP
)
}
fun String.isJson(): Boolean {
- return ((this.trim().startsWith("{") && this.trim().endsWith("}")) ||
- (this.trim().startsWith("[") && this.trim().endsWith("]")))
+ return (
+ (this.trim().startsWith("{") && this.trim().endsWith("}")) ||
+ (this.trim().startsWith("[") && this.trim().endsWith("]"))
+ )
}
fun Any.asJsonString(intend: Boolean? = false): String {
package org.onap.ccsdk.cds.controllerblueprints.core.common
object ApplicationConstants {
+
const val ACTIVE_Y = "Y"
const val ACTIVE_N = "N"
const val ASDC_ARTIFACT_TYPE_SDNC_MODEL = "SDNC_MODEL"
package org.onap.ccsdk.cds.controllerblueprints.core.config
open class BluePrintLoadConfiguration {
+
lateinit var blueprintDeployPath: String
lateinit var blueprintArchivePath: String
lateinit var blueprintWorkingPath: String
}
class Graph {
+
val nodes: MutableMap<String, Node> = hashMapOf()
val edges: MutableSet<Edge> = mutableSetOf()
}
data class Node(val id: String, var status: NodeStatus = NodeStatus.NOT_STARTED) {
+
val edges: MutableList<Edge> = ArrayList()
fun neighbors(): List<Node> = edges.map { edge -> edge.target(this) }
fun equivalentTo(other: Edge) =
(source == other.source && target == other.target) ||
- (source == other.target && target == other.source)
+ (source == other.target && target == other.source)
override fun toString() =
"${source.id}>${target.id}/$label($status)"
data class TermForm(val nodes: Collection<String>, val edges: List<Term>) {
data class Term(val source: String, val target: String, val label: EdgeLabel) {
+
override fun toString() = "Term($source, $target, $label)"
}
}
}
data class Link<out String, out EdgeLabel>(val node: String, val label: EdgeLabel) {
+
override fun toString() = if (label == null) "$node" else "$node/$label"
}
}
var description: String? = null
var version: String = "1.0.0"
var metadata: MutableMap<String, String>? = null
+
@get:JsonProperty("derived_from")
lateinit var derivedFrom: String
var attributes: MutableMap<String, AttributeDefinition>? = null
@get:JsonIgnore
var id: String? = null
var protocol: String? = null
+
@get:JsonProperty("token_type")
lateinit var tokenType: String
lateinit var token: String
class ConstraintClause {
var equal: JsonNode? = null
+
@get:JsonProperty("greater_than")
var greaterThan: JsonNode? = null
+
@get:JsonProperty("greater_or_equal")
var greaterOrEqual: JsonNode? = null
+
@get:JsonProperty("less_than")
var lessThan: JsonNode? = null
+
@get:JsonProperty("less_or_equal")
var lessOrEqual: JsonNode? = null
+
@get:JsonProperty("in_range")
var inRange: MutableList<JsonNode>? = null
+
@get:JsonProperty("valid_values")
var validValues: MutableList<JsonNode>? = null
var length: JsonNode? = null
+
@get:JsonProperty("min_length")
var minLength: JsonNode? = null
+
@get:JsonProperty("max_length")
var maxLength: JsonNode? = null
var pattern: String? = null
*/
class NodeFilterDefinition {
+
var properties: MutableMap<String, PropertyDefinition>? = null
var capabilities: MutableList<String>? = null
}
lateinit var file: String
var repository: String? = null
var description: String? = null
+
@get:JsonProperty("deploy_Path")
var deployPath: String? = null
var properties: MutableMap<String, JsonNode>? = null
var id: String? = null
lateinit var file: String
var repository: String? = null
+
@get:JsonProperty("namespace_uri")
var namespaceUri: String? = null
+
@get:JsonProperty("namespace_prefix")
var namespacePrefix: String? = null
}
var description: String? = null
var required: Boolean? = null
lateinit var type: String
+
@get:JsonProperty("input-param")
var inputparam: Boolean? = null
+
@get:JsonProperty("default")
var defaultValue: JsonNode? = null
var status: String? = null
var constraints: MutableList<ConstraintClause>? = null
+
@get:JsonProperty("entry_schema")
var entrySchema: EntrySchema? = null
+
@get:JsonProperty("external-schema")
var externalSchema: String? = null
var metadata: MutableMap<String, String>? = null
+
// Mainly used in Workflow Outputs
@get:ApiModelProperty(notes = "Property Value, It may be Expression or Json type values")
var value: JsonNode? = null
*/
class AttributeDefinition {
+
@get:JsonIgnore
var id: String? = null
var description: String? = null
var required: Boolean? = null
lateinit var type: String
+
@JsonProperty("default")
var defaultValue: JsonNode? = null
var status: String? = null
var constraints: MutableList<ConstraintClause>? = null
+
@JsonProperty("entry_schema")
var entrySchema: EntrySchema? = null
+
// Mainly used in DSL definitions
@get:ApiModelProperty(notes = "Attribute Value, It may be Expression or Json type values")
var value: JsonNode? = null
}
class Implementation {
+
var primary: String? = null
var dependencies: MutableList<String>? = null
+
@get:JsonProperty("operation_host")
var operationHost: String = BluePrintConstants.PROPERTY_SELF
+
// Timeout value in seconds
var timeout: Int = 180
var lock: LockAssignment? = null
}
class LockAssignment {
+
lateinit var key: JsonNode
var acquireTimeout: JsonNode = Integer(180).asJsonType()
}
@get:JsonIgnore
var id: String? = null
var description: String? = null
+
@get:JsonProperty("event_type")
lateinit var eventType: String
+
@get:JsonProperty("target_filter")
var targetFilter: EventFilterDefinition? = null
var condition: ConditionClause? = null
class Activity {
var delegate: String? = null
+
@get:JsonProperty("set_state")
var setState: String? = null
+
@get:JsonProperty("call_operation")
var callOperation: String? = null
var inlines: ArrayList<String>? = null
@get:JsonIgnore
var id: String? = null
lateinit var target: String
+
@get:JsonProperty("target_relationship")
lateinit var targetRelationship: String
lateinit var condition: ArrayList<ConditionClause>
var id: String? = null
var description: String? = null
var target: String? = null
+
@JsonProperty("target_relationship")
var targetRelationship: String? = null
+
@JsonProperty("operation_host")
var operationHost: String? = null
var activities: ArrayList<Activity>? = null
+
@get:JsonProperty("on_success")
var onSuccess: ArrayList<String>? = null
+
@get:JsonProperty("on_failure")
var onFailure: ArrayList<String>? = null
}
*/
class CapabilityDefinition {
+
@get:JsonIgnore
var id: String? = null
lateinit var type: String
var description: String? = null
var properties: MutableMap<String, PropertyDefinition>? = null
+
@get:JsonProperty("valid_source_types")
var validSourceTypes: MutableList<String>? = null
var occurrences: MutableList<Any>? = null
@get:JsonProperty("mime_type")
var mimeType: String? = null
+
@get:JsonProperty("file_ext")
var fileExt: MutableList<String>? = null
}
*/
class DataType : EntityType() {
+
var constraints: MutableList<ConstraintClause>? = null
}
*/
class NodeType : EntityType() {
+
var capabilities: MutableMap<String, CapabilityDefinition>? = null
var requirements: MutableMap<String, RequirementDefinition>? = null
var interfaces: MutableMap<String, InterfaceDefinition>? = null
*/
class RequirementType : EntityType() {
+
var requirements: MutableMap<String, RequirementDefinition>? = null
var capabilities: MutableMap<String, CapabilityDefinition>? = null
var interfaces: MutableMap<String, InterfaceDefinition>? = null
*/
class RelationshipType : EntityType() {
+
var interfaces: MutableMap<String, InterfaceDefinition>? = null
+
@get:JsonProperty("valid_target_types")
var validTargetTypes: MutableList<String>? = null
}
*/
class GroupType : EntityType() {
+
var members: MutableList<String>? = null
var requirements: ArrayList<RequirementDefinition>? = null
var capabilities: MutableMap<String, CapabilityDefinition>? = null
var id: String? = null
var description: String? = null
var inputs: MutableMap<String, PropertyDefinition>? = null
+
@get:JsonProperty("node_templates")
var nodeTemplates: MutableMap<String, NodeTemplate>? = null
+
@get:JsonProperty("relationship_templates")
var relationshipTemplates: MutableMap<String, RelationshipTemplate>? = null
var policies: MutableMap<String, PolicyDefinition>? = null
var outputs: MutableMap<String, PropertyDefinition>? = null
+
@get:JsonProperty("substitution_mappings")
var substitutionMappings: Any? = null
var workflows: MutableMap<String, Workflow>? = null
}
class SubstitutionMapping {
+
@get:JsonProperty("node_type")
lateinit var nodeType: String
lateinit var capabilities: ArrayList<String>
}
class EntrySchema {
+
lateinit var type: String
var constraints: MutableList<ConstraintClause>? = null
}
class InterfaceAssignment {
+
@get:JsonIgnore
var id: String? = null
var operations: MutableMap<String, OperationAssignment>? = null
*/
open class NodeTemplate {
+
@get:JsonIgnore
var id: String? = null
var description: String? = null
lateinit var type: String
var metadata: MutableMap<String, String>? = null
var directives: MutableList<String>? = null
+
// @get:JsonSerialize(using = PropertyDefinitionValueSerializer::class)
var properties: MutableMap<String, JsonNode>? = null
var attributes: MutableMap<String, JsonNode>? = null
var requirements: MutableMap<String, RequirementAssignment>? = null
var interfaces: MutableMap<String, InterfaceAssignment>? = null
var artifacts: MutableMap<String, ArtifactDefinition>? = null
+
@get:JsonProperty("node_filter")
var nodeFilter: NodeFilterDefinition? = null
var copy: String? = null
}
class OperationAssignment {
+
@get:JsonIgnore
var id: String? = null
var description: String? = null
*/
class RelationshipTemplate {
+
@get:JsonIgnore
var id: String? = null
lateinit var type: String
*/
class RequirementAssignment {
+
@get:JsonIgnore
var id: String? = null
var capability: String? = null
var node: String? = null
+
// Relationship Type or Relationship Template
var relationship: String? = null
}
class Workflow {
+
@get:JsonIgnore
var id: String? = null
var description: String? = null
}
class ConditionClause {
+
var and: ArrayList<MutableMap<String, Any>>? = null
var or: ArrayList<MutableMap<String, Any>>? = null
+
@get:JsonProperty("assert")
var assertConditions: ArrayList<MutableMap<String, Any>>? = null
}
*/
@JsonPropertyOrder(
- value = ["toscaDefinitionsVersion", "description", "metadata", "imports", "dsl_definitions",
- "topologyTemplate"]
+ value = [
+ "toscaDefinitionsVersion", "description", "metadata", "imports", "dsl_definitions",
+ "topologyTemplate"
+ ]
)
class ServiceTemplate : Cloneable {
@get:JsonIgnore
var id: String? = null
+
@get:JsonProperty("tosca_definitions_version")
var toscaDefinitionsVersion: String = "controller_blueprint_1_0_0"
var metadata: MutableMap<String, String>? = null
var description: String? = null
+
@get:JsonProperty("dsl_definitions")
var dslDefinitions: MutableMap<String, JsonNode>? = null
var repositories: MutableMap<String, RepositoryDefinition>? = null
var imports: MutableList<ImportDefinition>? = null
+
@get:JsonProperty("artifact_types")
var artifactTypes: MutableMap<String, ArtifactType>? = null
+
@get:JsonProperty("data_types")
var dataTypes: MutableMap<String, DataType>? = null
+
@get:JsonProperty("relationship_types")
var relationshipTypes: MutableMap<String, RelationshipType>? = null
+
@get:JsonProperty("node_types")
var nodeTypes: MutableMap<String, NodeType>? = null
+
@get:JsonProperty("policy_types")
var policyTypes: MutableMap<String, PolicyType>? = null
+
@get:JsonProperty("topology_template")
var topologyTemplate: TopologyTemplate? = null
}
class ToscaMetaData {
+
lateinit var toscaMetaFileVersion: String
lateinit var csarVersion: String
lateinit var createdBy: String
}
},
INVALID_FILE_EXTENSION(2, 415) {
+
override fun message(detailMsg: String): String {
return "Unexpected file extension. Details : {$detailMsg}"
}
},
BLUEPRINT_PATH_MISSING(3, 503) {
+
override fun message(detailMsg: String): String {
return "Blueprint path missing or wrong. Details : {$detailMsg}"
}
},
BLUEPRINT_WRITING_FAIL(4, 503) {
+
override fun message(detailMsg: String): String {
return "Fail to write blueprint files. Details : {$detailMsg}"
}
},
IO_FILE_INTERRUPT(5, 503) {
+
override fun message(detailMsg: String): String {
return "IO file system interruption. Details : {$detailMsg}"
}
},
INVALID_REQUEST_FORMAT(6, 400) {
+
override fun message(detailMsg: String): String {
return "Bad request. Details : {$detailMsg}"
}
},
UNAUTHORIZED_REQUEST(7, 401) {
+
override fun message(detailMsg: String): String {
return "The request requires user authentication. Details : {$detailMsg}"
}
},
REQUEST_NOT_FOUND(8, 404) {
+
override fun message(detailMsg: String): String {
return "Request mapping doesn't exist. Details : {$detailMsg}"
}
},
RESOURCE_NOT_FOUND(9, 404) {
+
override fun message(detailMsg: String): String {
return "No response was found for this request in the server. Details : {$detailMsg}"
}
},
CONFLICT_ADDING_RESOURCE(10, 409) {
+
override fun message(detailMsg: String): String {
return "Duplicated entry while saving Blueprint. Details : {$detailMsg}"
}
},
DUPLICATE_DATA(11, 409) {
+
override fun message(detailMsg: String): String {
return "Duplicated data - was expecting one result, got more than one. Details : {$detailMsg}"
}
package org.onap.ccsdk.cds.controllerblueprints.core.dsl
-abstract class AbstractNodeTemplateOperationImplBuilder<Prop : PropertiesAssignmentBuilder,
- In : PropertiesAssignmentBuilder, Out : PropertiesAssignmentBuilder>(
- id: String,
- type: String,
- private val interfaceName: String,
- description: String
- ) : AbstractNodeTemplatePropertyImplBuilder<Prop>(id, type, description) {
+abstract class AbstractNodeTemplateOperationImplBuilder<Prop : PropertiesAssignmentBuilder, In : PropertiesAssignmentBuilder, Out : PropertiesAssignmentBuilder>(
+ id: String,
+ type: String,
+ private val interfaceName: String,
+ description: String
+) : AbstractNodeTemplatePropertyImplBuilder<Prop>(id, type, description) {
open fun definedOperation(description: String, block: OperationAssignmentBuilder<In, Out>.() -> Unit) {
typedOperation<In, Out>(interfaceName, description, block)
fun BluePrintTypes.artifactTypeK8sProfileFolder(): ArtifactType {
return artifactType(
- id = BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE,
- version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BluePrintConstants.MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION,
- description = "K8s Profile Folder Artifact"
+ id = BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE,
+ version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION,
+ description = "K8s Profile Folder Artifact"
) {
}
}
}
class DSLWorkflowBuilder(private val actionName: String, private val description: String) {
+
private val dslWorkflow = DSLWorkflow()
private var steps: MutableMap<String, Step>? = null
private var inputs: MutableMap<String, PropertyDefinition>? = null
}
class DSLWorkflow {
+
@get:JsonIgnore
var id: String? = null
lateinit var description: String
}
class DSLComponent {
+
@get:JsonIgnore
lateinit var id: String
lateinit var type: String
}
class DSLRegistryComponent {
+
lateinit var id: String
lateinit var type: String
lateinit var version: String
import kotlin.reflect.jvm.reflect
open class TopologyTemplateBuilder {
+
private var topologyTemplate = TopologyTemplate()
var nodeTemplates: MutableMap<String, NodeTemplate>? = null
var relationshipTemplates: MutableMap<String, RelationshipTemplate>? = null
private val type: String,
private val description: String? = ""
) {
+
var relationshipTemplate: RelationshipTemplate = RelationshipTemplate()
var properties: MutableMap<String, JsonNode>? = null
}
open class CapabilityAssignmentBuilder(private val id: String) {
+
var capabilityAssignment: CapabilityAssignment = CapabilityAssignment()
var attributes: MutableMap<String, JsonNode>? = null
var properties: MutableMap<String, JsonNode>? = null
}
class ImplementationBuilder(private val timeout: Int, private val operationHost: String) {
+
private val implementation = Implementation()
fun primary(primary: String) {
}
open class PropertiesAssignmentBuilder {
+
var properties: MutableMap<String, JsonNode> = hashMapOf()
fun property(id: String, value: Any) {
}
open class AttributesAssignmentBuilder {
+
var attributes: MutableMap<String, JsonNode> = hashMapOf()
fun attribute(id: String, value: String) {
}
class PropertiesDefinitionBuilder {
+
private val properties: MutableMap<String, PropertyDefinition> = hashMapOf()
fun property(id: String, property: PropertyDefinition) {
}
class ConstraintsClauseBuilder {
+
val constraints: MutableList<ConstraintClause> = mutableListOf()
fun constrain(block: ConstraintClauseBuilder.() -> Unit) {
}
class ConstraintClauseBuilder {
+
private val constraintClause = ConstraintClause()
fun equal(equal: Any) = equal(equal.asJsonType())
}
class EntrySchemaBuilder(private val type: String) {
+
private var entrySchema: EntrySchema = EntrySchema()
fun constrain(block: ConstraintClauseBuilder.() -> Unit) {
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
interface BluePrintEnhancer<T> {
+
fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, type: T)
}
}
open class BluePrintTextNode(v: String) : TextNode(v) {
+
override fun toString(): String {
var len = this._value.length
len = len + 2 + (len shr 4)
import kotlin.system.measureTimeMillis
open class BluePrintCompileService {
+
val log = logger(BluePrintCompileService::class)
companion object {
+
val classPaths = classpathFromClasspathProperty()?.joinToString(File.pathSeparator) {
it.absolutePath
}
}
val deferredCompile = async {
val k2jvmCompiler = K2JVMCompiler()
+
/** Construct Arguments */
val arguments = k2jvmCompiler.createArguments()
parseCommandLineArguments(args, arguments)
val messageCollector = CompilationMessageCollector()
+
/** Compile with arguments */
val exitCode: ExitCode = k2jvmCompiler.exec(messageCollector, Services.EMPTY, arguments)
when (exitCode) {
import java.net.URLClassLoader
object BluePrintCompileCache {
+
val log = logger(BluePrintCompileCache::class)
private val classLoaderCache: LoadingCache<String, URLClassLoader> = CacheBuilder.newBuilder()
* Blueprint CBA extracted file location
*/
var rootPath = "."
+
/**
* Root Definition file path
*/
fun nodeTemplateOperationImplementation(nodeTemplateName: String, interfaceName: String, operationName: String):
Implementation? {
- return nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName).implementation
- }
+ return nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName).implementation
+ }
fun nodeTemplateInterfaceOperationInputs(
nodeTemplateName: String,
fun checkContainsExpression(propertyAssignmentNode: JsonNode): Boolean {
val json = propertyAssignmentNode.toString()
// FIXME("Check if any Optimisation needed")
- return (json.contains(BluePrintConstants.EXPRESSION_GET_INPUT) ||
+ return (
+ json.contains(BluePrintConstants.EXPRESSION_GET_INPUT) ||
json.contains(BluePrintConstants.EXPRESSION_GET_ATTRIBUTE) ||
- json.contains(BluePrintConstants.EXPRESSION_GET_PROPERTY))
+ json.contains(BluePrintConstants.EXPRESSION_GET_PROPERTY)
+ )
}
@JvmStatic
throw BluePrintException(
String.format(
"missing property expression, " +
- "it should be [ <modelable_entity_name>, <optional_req_or_cap_name>, <property_name>, " +
- "<nested_property_name_or_index_1>, ..., <nested_property_name_or_index_n> ] , but present {}", jsonNode
+ "it should be [ <modelable_entity_name>, <optional_req_or_cap_name>, <property_name>, " +
+ "<nested_property_name_or_index_1>, ..., <nested_property_name_or_index_n> ] , but present {}",
+ jsonNode
)
)
}
throw BluePrintException(
String.format(
"missing attribute expression, " +
- "it should be [ <modelable_entity_name>, <optional_req_or_cap_name>, <attribute_name>," +
- " <nested_attribute_name_or_index_1>, ..., <nested_attribute_name_or_index_n> ] , but present {}", jsonNode
+ "it should be [ <modelable_entity_name>, <optional_req_or_cap_name>, <attribute_name>," +
+ " <nested_attribute_name_or_index_1>, ..., <nested_attribute_name_or_index_n> ] , but present {}",
+ jsonNode
)
)
}
throw BluePrintException(
String.format(
"missing operation output expression, " +
- "it should be (<modelable_entity_name>, <interface_name>, <operation_name>, <output_variable_name>) , but present {}",
+ "it should be (<modelable_entity_name>, <interface_name>, <operation_name>, <output_variable_name>) , but present {}",
jsonNode
)
)
throw BluePrintException(
String.format(
"missing artifact expression, " +
- "it should be [ <modelable_entity_name>, <artifact_name>, <location>, <remove> ] , but present {}", jsonNode
+ "it should be [ <modelable_entity_name>, <artifact_name>, <location>, <remove> ] , but present {}",
+ jsonNode
)
)
}
class BluePrintImportService(private val parentServiceTemplate: ServiceTemplate, private val blueprintBasePath: String) {
companion object {
+
private const val PARENT_SERVICE_TEMPLATE: String = "parent"
}
override fun resolveNodeTemplateCapabilityProperties(nodeTemplateName: String, capabilityName: String):
MutableMap<String, JsonNode> {
- log.info("resolveNodeTemplateCapabilityProperties for node template($nodeTemplateName) capability($capabilityName)")
- val nodeTemplate: NodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName)
+ log.info("resolveNodeTemplateCapabilityProperties for node template($nodeTemplateName) capability($capabilityName)")
+ val nodeTemplate: NodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName)
- val propertyAssignments = nodeTemplate.capabilities?.get(capabilityName)?.properties ?: hashMapOf()
+ val propertyAssignments = nodeTemplate.capabilities?.get(capabilityName)?.properties ?: hashMapOf()
- val propertyDefinitions = bluePrintContext.nodeTemplateNodeType(nodeTemplateName)
- .capabilities?.get(capabilityName)?.properties ?: hashMapOf()
+ val propertyDefinitions = bluePrintContext.nodeTemplateNodeType(nodeTemplateName)
+ .capabilities?.get(capabilityName)?.properties ?: hashMapOf()
- /**
- * Resolve the Capability Property Assignment Values.
- */
- return resolveNodeTemplatePropertyAssignments(nodeTemplateName, propertyDefinitions, propertyAssignments)
- }
+ /**
+ * Resolve the Capability Property Assignment Values.
+ */
+ return resolveNodeTemplatePropertyAssignments(nodeTemplateName, propertyDefinitions, propertyAssignments)
+ }
override fun resolveNodeTemplateInterfaceOperationInputs(
nodeTemplateName: String,
val nodeTypeInterfaceOperationOutputs: MutableMap<String, PropertyDefinition> =
bluePrintContext.nodeTypeInterfaceOperationOutputs(nodeTypeName, interfaceName, operationName)
?: hashMapOf()
+
/**
* Resolve the Property Output Assignment Values.
*/
else -> {
throw BluePrintProcessorException(
"Unknown Artifact type, expecting ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA}" +
- "or ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY}"
+ "or ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY}"
)
}
}
?: throw BluePrintException(
format(
"Failed to get NodeTemplate({}) capability definition ({}) " +
- "from NodeType({}) ", nodeTemplateName, capabilityName, nodeTemplate.type
+ "from NodeType({}) ",
+ nodeTemplateName, capabilityName, nodeTemplate.type
)
)
?: throw BluePrintException(
format(
"Failed to get NodeTemplate({}) requirement definition ({}) from" +
- " NodeType({}) ", nodeTemplateName, requirementName, nodeTemplate.type
+ " NodeType({}) ",
+ nodeTemplateName, requirementName, nodeTemplate.type
)
)
// Validate Requirement Assignment
?: throw BluePrintException(
format(
"Failed to get NodeTemplate({}) interface definition ({}) from" +
- " NodeType({}) ", nodeTemplateName, interfaceAssignmentName, nodeTemplate.type
+ " NodeType({}) ",
+ nodeTemplateName, interfaceAssignmentName, nodeTemplate.type
)
)
?: throw BluePrintException(
format(
"Failed to get NodeTemplate({}) operation definition ({}) " +
- "property definition({})", nodeTemplateName, operationAssignmentName, propertyName
+ "property definition({})",
+ nodeTemplateName, operationAssignmentName, propertyName
)
)
// Check the property values with property definition
?: throw BluePrintException(
format(
"Failed to get NodeTemplate({}) operation definition ({}) " +
- "output property definition({})", nodeTemplateName, operationAssignmentName,
+ "output property definition({})",
+ nodeTemplateName, operationAssignmentName,
propertyName
)
)
?: throw BluePrintException(
format(
"failed to get artifact definitions for node template ({})'s " +
- "artifact name ({}) ", nodeTemplateName, artifactExpression.artifactName
+ "artifact name ({}) ",
+ nodeTemplateName, artifactExpression.artifactName
)
)
package org.onap.ccsdk.cds.controllerblueprints.core.utils
import com.google.common.base.Predicates
+import org.apache.commons.compress.archivers.ArchiveEntry
+import org.apache.commons.compress.archivers.ArchiveInputStream
+import org.apache.commons.compress.archivers.ArchiveOutputStream
+import org.apache.commons.compress.archivers.tar.TarArchiveEntry
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
+import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
+import org.apache.commons.compress.archivers.zip.ZipFile
+import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
+import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.slf4j.LoggerFactory
import java.io.BufferedInputStream
import java.io.Closeable
import java.io.File
import java.io.FileOutputStream
+import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
-import java.io.IOException
import java.io.OutputStream
import java.nio.file.FileVisitResult
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.SimpleFileVisitor
import java.nio.file.attribute.BasicFileAttributes
-import java.util.function.Predicate
-import org.apache.commons.compress.archivers.ArchiveEntry
-import org.apache.commons.compress.archivers.ArchiveInputStream
-import org.apache.commons.compress.archivers.ArchiveOutputStream
-import org.apache.commons.compress.archivers.tar.TarArchiveEntry
-import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
-import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
-import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
-import org.apache.commons.compress.archivers.zip.ZipFile
-import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
-import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream
import java.util.Enumeration
+import java.util.function.Predicate
import java.util.zip.Deflater
enum class ArchiveType {
class BluePrintArchiveUtils {
companion object {
+
private val log = LoggerFactory.getLogger(BluePrintArchiveUtils::class.java)
/**
compressionLevel: Int = Deflater.DEFAULT_COMPRESSION,
fixedModificationTime: Long? = null
): T
- where T : OutputStream {
+ where T : OutputStream {
val stream: ArchiveOutputStream = if (archiveType == ArchiveType.Zip)
ZipArchiveOutputStream(output).apply { setLevel(compressionLevel) }
else
TarArchiveOutputStream(GzipCompressorOutputStream(output))
stream
.use { aos ->
- Files.walkFileTree(baseDir, object : SimpleFileVisitor<Path>() {
- @Throws(IOException::class)
- override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult {
- if (pathFilter.test(file)) {
- var archiveEntry: ArchiveEntry = aos.createArchiveEntry(file.toFile(),
- baseDir.relativize(file).toString())
+ Files.walkFileTree(
+ baseDir,
+ object : SimpleFileVisitor<Path>() {
+ @Throws(IOException::class)
+ override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult {
+ if (pathFilter.test(file)) {
+ var archiveEntry: ArchiveEntry = aos.createArchiveEntry(
+ file.toFile(),
+ baseDir.relativize(file).toString()
+ )
+ if (archiveType == ArchiveType.Zip) {
+ val entry = archiveEntry as ZipArchiveEntry
+ fixedModificationTime?.let {
+ entry.time = it
+ }
+ entry.time = 0
+ }
+ aos.putArchiveEntry(archiveEntry)
+ Files.copy(file, aos)
+ aos.closeArchiveEntry()
+ }
+ return FileVisitResult.CONTINUE
+ }
+
+ @Throws(IOException::class)
+ override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult {
+ var archiveEntry: ArchiveEntry?
if (archiveType == ArchiveType.Zip) {
- val entry = archiveEntry as ZipArchiveEntry
+ val entry = ZipArchiveEntry(baseDir.relativize(dir).toString() + "/")
fixedModificationTime?.let {
entry.time = it
}
- entry.time = 0
- }
+ archiveEntry = entry
+ } else
+ archiveEntry = TarArchiveEntry(baseDir.relativize(dir).toString() + "/")
aos.putArchiveEntry(archiveEntry)
- Files.copy(file, aos)
aos.closeArchiveEntry()
+ return FileVisitResult.CONTINUE
}
- return FileVisitResult.CONTINUE
}
-
- @Throws(IOException::class)
- override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult {
- var archiveEntry: ArchiveEntry?
- if (archiveType == ArchiveType.Zip) {
- val entry = ZipArchiveEntry(baseDir.relativize(dir).toString() + "/")
- fixedModificationTime?.let {
- entry.time = it
- }
- archiveEntry = entry
- } else
- archiveEntry = TarArchiveEntry(baseDir.relativize(dir).toString() + "/")
- aos.putArchiveEntry(archiveEntry)
- aos.closeArchiveEntry()
- return FileVisitResult.CONTINUE
- }
- })
+ )
}
return output
}
}
class ArchiveEnumerator : Enumeration<ArchiveEntry>, Closeable {
+
private val zipArchive: ZipFile?
private val zipEnumeration: Enumeration<ZipArchiveEntry>?
private val archiveStream: ArchiveInputStream?
check(definitionDir.exists()) {
throw BluePrintException(
- ErrorCode.BLUEPRINT_PATH_MISSING.value, "couldn't get definition file under " +
- "path(${definitionDir.absolutePath})"
+ ErrorCode.BLUEPRINT_PATH_MISSING.value,
+ "couldn't get definition file under " +
+ "path(${definitionDir.absolutePath})"
)
}
Files.write(definitionFile.toPath(), content.toByteArray(), StandardOpenOption.CREATE_NEW)
check(definitionFile.exists()) {
throw BluePrintException(
- ErrorCode.BLUEPRINT_WRITING_FAIL.value, "couldn't write definition file under " +
- "path(${definitionFile.absolutePath})"
+ ErrorCode.BLUEPRINT_WRITING_FAIL.value,
+ "couldn't write definition file under " +
+ "path(${definitionFile.absolutePath})"
)
}
}
Files.write(typeFile.toPath(), content.toByteArray(), StandardOpenOption.CREATE_NEW)
check(typeFile.exists()) {
throw BluePrintException(
- ErrorCode.BLUEPRINT_WRITING_FAIL.value, "couldn't write $type.json file under " +
- "path(${typeFile.absolutePath})"
+ ErrorCode.BLUEPRINT_WRITING_FAIL.value,
+ "couldn't write $type.json file under " +
+ "path(${typeFile.absolutePath})"
)
}
}
private fun getMetaDataContent(): String {
return "TOSCA-Meta-File-Version: 1.0.0" +
- "\nCSAR-Version: <VERSION>" +
- "\nCreated-By: <AUTHOR NAME>" +
- "\nEntry-Definitions: Definitions/<BLUEPRINT_NAME>.json" +
- "\nTemplate-Name: <BLUEPRINT_NAME>" +
- "\nTemplate-Version: <BLUEPRINT_VERSION>" +
- "\nTemplate-Type: <BLUEPRINT_TYPE>" +
- "\nTemplate-Tags: <TAGS>"
+ "\nCSAR-Version: <VERSION>" +
+ "\nCreated-By: <AUTHOR NAME>" +
+ "\nEntry-Definitions: Definitions/<BLUEPRINT_NAME>.json" +
+ "\nTemplate-Name: <BLUEPRINT_NAME>" +
+ "\nTemplate-Version: <BLUEPRINT_VERSION>" +
+ "\nTemplate-Type: <BLUEPRINT_TYPE>" +
+ "\nTemplate-Tags: <TAGS>"
}
fun getBluePrintFile(fileName: String, targetPath: Path): File {
val file = File(filePath)
check(file.exists()) {
throw BluePrintException(
- ErrorCode.BLUEPRINT_PATH_MISSING.value, "couldn't get definition file under " +
- "path(${file.absolutePath})"
+ ErrorCode.BLUEPRINT_PATH_MISSING.value,
+ "couldn't get definition file under " +
+ "path(${file.absolutePath})"
)
}
return file
fun getCbaStorageDirectory(path: String): Path {
check(StringUtils.isNotBlank(path)) {
throw BluePrintException(
- ErrorCode.BLUEPRINT_PATH_MISSING.value, "couldn't get " +
- "Blueprint folder under path($path)"
+ ErrorCode.BLUEPRINT_PATH_MISSING.value,
+ "couldn't get " +
+ "Blueprint folder under path($path)"
)
}
val urls = arrayListOf<URL>()
directory.walkTopDown()
- .filter { it.name.endsWith(COMPILED_JAR_SUFFIX) }
- .forEach {
- log.debug("Adding (${it.absolutePath}) to classLoader (${directory.absolutePath})")
+ .filter { it.name.endsWith(COMPILED_JAR_SUFFIX) }
+ .forEach {
+ log.debug("Adding (${it.absolutePath}) to classLoader (${directory.absolutePath})")
- urls.add(it.toURI().toURL())
- }
+ urls.add(it.toURI().toURL())
+ }
return URLClassLoader(urls.toTypedArray(), this.javaClass.classLoader)
}
class BluePrintMetadataUtils {
companion object {
+
private val log = LoggerFactory.getLogger(this::class.toString())
suspend fun toscaMetaData(basePath: String): ToscaMetaData {
/** Get the default blueprint runtime for [id] and [blueprintBasePath] */
suspend fun getBluePrintRuntime(id: String, blueprintBasePath: String):
BluePrintRuntimeService<MutableMap<String, JsonNode>> {
- val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
- return getBluePrintRuntime(id, bluePrintContext)
- }
+ val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
+ return getBluePrintRuntime(id, bluePrintContext)
+ }
/** Get the default blocking blueprint runtime api for [id] and [blueprintBasePath] used in testing */
fun bluePrintRuntime(id: String, blueprintBasePath: String):
BluePrintRuntimeService<MutableMap<String, JsonNode>> = runBlocking {
- val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
- getBluePrintRuntime(id, bluePrintContext)
- }
+ val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
+ getBluePrintRuntime(id, bluePrintContext)
+ }
/** Get the default blueprint runtime from [bluePrintContext] */
fun getBluePrintRuntime(id: String, bluePrintContext: BluePrintContext):
BluePrintRuntimeService<MutableMap<String, JsonNode>> {
- checkNotEmpty(bluePrintContext.rootPath) { "blueprint context root path is missing." }
- checkNotEmpty(bluePrintContext.entryDefinition) { "blueprint context entry definition is missing." }
- val blueprintBasePath = bluePrintContext.rootPath
- val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
- bluePrintRuntimeService.put(
- BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH,
- blueprintBasePath.asJsonPrimitive()
- )
- bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive())
- return bluePrintRuntimeService
- }
+ checkNotEmpty(bluePrintContext.rootPath) { "blueprint context root path is missing." }
+ checkNotEmpty(bluePrintContext.entryDefinition) { "blueprint context entry definition is missing." }
+ val blueprintBasePath = bluePrintContext.rootPath
+ val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
+ bluePrintRuntimeService.put(
+ BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH,
+ blueprintBasePath.asJsonPrimitive()
+ )
+ bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive())
+ return bluePrintRuntimeService
+ }
/** Get the blueprint runtime for enhancement start for [id] and [blueprintBasePath] */
suspend fun getBaseEnhancementBluePrintRuntime(id: String, blueprintBasePath: String):
BluePrintRuntimeService<MutableMap<String, JsonNode>> {
- val bluePrintContext: BluePrintContext = getBaseEnhancementBluePrintContext(blueprintBasePath)
+ val bluePrintContext: BluePrintContext = getBaseEnhancementBluePrintContext(blueprintBasePath)
- val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
- bluePrintRuntimeService.put(
- BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH,
- blueprintBasePath.asJsonPrimitive()
- )
- bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive())
+ val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
+ bluePrintRuntimeService.put(
+ BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH,
+ blueprintBasePath.asJsonPrimitive()
+ )
+ bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive())
- return bluePrintRuntimeService
- }
+ return bluePrintRuntimeService
+ }
/** Get the default blueprint runtime for enhancement start for [id], [blueprintBasePath] and [executionContext] */
suspend fun getBluePrintRuntime(
executionContext: MutableMap<String, JsonNode>
):
BluePrintRuntimeService<MutableMap<String, JsonNode>> {
- val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
- val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
- executionContext.forEach {
- bluePrintRuntimeService.put(it.key, it.value)
- }
+ val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath)
+ val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext)
+ executionContext.forEach {
+ bluePrintRuntimeService.put(it.key, it.value)
+ }
- bluePrintRuntimeService.setExecutionContext(executionContext)
- return bluePrintRuntimeService
- }
+ bluePrintRuntimeService.setExecutionContext(executionContext)
+ return bluePrintRuntimeService
+ }
/** Get the default blueprint context for [blueprintBasePath]*/
suspend fun getBluePrintContext(blueprintBasePath: String): BluePrintContext {
bluePrintContext: BluePrintContext,
fileName: String,
context: MutableMap<String,
- JsonNode>
+ JsonNode>
) {
val jsonNode = JacksonUtils.jsonNodeFromClassPathFile(fileName)
return assignInputs(bluePrintContext, jsonNode, context)
// log.trace("Reading Classpath File($fileName)")
IOUtils.toString(
JacksonUtils::class.java.classLoader
- .getResourceAsStream(fileName), Charset.defaultCharset()
+ .getResourceAsStream(fileName),
+ Charset.defaultCharset()
)
}
withContext(Dispatchers.Default) {
IOUtils.toString(
JacksonUtils::class.java.classLoader
- .getResourceAsStream(fileName), Charset.defaultCharset()
+ .getResourceAsStream(fileName),
+ Charset.defaultCharset()
)
}
}
class PropertyDefinitionUtils {
companion object {
+
fun hasLogProtect(metadata: MutableMap<String, String>?) = metadata?.get(LOG_PROTECT)
- ?.let {
- when (it.toLowerCase()) {
- "true" -> true
- "yes" -> true
- "y" -> true
- else -> false
- }
- } ?: false
+ ?.let {
+ when (it.toLowerCase()) {
+ "true" -> true
+ "yes" -> true
+ "y" -> true
+ else -> false
+ }
+ } ?: false
fun hasLogProtect(propertyDefinition: PropertyDefinition?) = propertyDefinition
- ?.let { p -> hasLogProtect(p.metadata) } ?: false
+ ?.let { p -> hasLogProtect(p.metadata) } ?: false
}
}
toMerge.topologyTemplate?.nodeTemplates?.let {
parentServiceTemplate.topologyTemplate?.nodeTemplates =
parentServiceTemplate.topologyTemplate?.nodeTemplates
- ?: hashMapOf()
+ ?: hashMapOf()
parentServiceTemplate.topologyTemplate?.nodeTemplates?.putAll(parentServiceTemplate.topologyTemplate?.nodeTemplates as MutableMap)
}
toMerge.topologyTemplate?.relationshipTemplates?.let {
parentServiceTemplate.topologyTemplate?.relationshipTemplates =
parentServiceTemplate.topologyTemplate?.relationshipTemplates
- ?: hashMapOf()
+ ?: hashMapOf()
parentServiceTemplate.topologyTemplate?.relationshipTemplates?.putAll(parentServiceTemplate.topologyTemplate?.relationshipTemplates as MutableMap)
}
import kotlin.test.assertTrue
class FileExtensionFunctionTest {
+
val blueprintBasePath = TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG
@Test
import kotlin.test.assertEquals
class MDCContextTest {
+
val log = logger(MDCContextTest::class)
+
@Before
fun setup() {
MDC.clear()
package org.onap.ccsdk.cds.controllerblueprints.core
object TestConstants {
+
const val PATH_TEST_BLUEPRINTS = "./../../../../../components/model-catalog/blueprint-model/test-blueprint"
const val PATH_TEST_BLUEPRINTS_BASECONFIG = "$PATH_TEST_BLUEPRINTS/baseconfiguration"
block: TestNodeTemplateOperationImplBuilder.() -> Unit
):
NodeTemplate {
- return TestNodeTemplateOperationImplBuilder(id, description).apply(block).build()
-}
+ return TestNodeTemplateOperationImplBuilder(id, description).apply(block).build()
+ }
class TestNodeTemplateOperationImplBuilder(id: String, description: String) :
AbstractNodeTemplateOperationImplBuilder<TestProperty, TestInput, TestOutput>(
)
class TestProperty : PropertiesAssignmentBuilder() {
+
fun prop1(prop1: String) {
property("prop1", prop1.asJsonPrimitive())
}
}
class TestInput : PropertiesAssignmentBuilder() {
+
fun request(request: String) {
property("request", request.asJsonPrimitive())
}
}
class TestOutput : PropertiesAssignmentBuilder() {
+
fun response(response: String) {
response(response.asJsonPrimitive())
}
val bluePrintScriptsService = BluePrintScriptsServiceImpl()
val basePath = normalizedPathName("src/test/resources/compile")
+
/** Load the Definitions */
val bluePrintDefinitions = bluePrintScriptsService
.scriptInstance<BluePrintDefinitions>(
val bluePrintRuntimeService = getBluePrintRuntimeService()
bluePrintRuntimeService.setNodeTemplateAttributeValue(
- "resource-assignment", "assignment-map",
- JacksonUtils.jsonNode("""
+ "resource-assignment", "assignment-map",
+ JacksonUtils.jsonNode(
+ """
{
"a-prefix":{
"an-object":{
}
}
}
- """.trimIndent())
+ """.trimIndent()
+ )
)
val propertyDefinitions = mutableMapOf<String, PropertyDefinition>(
- "resolution" to PropertyDefinition().apply {
- this.type = "json"
- this.value = JacksonUtils.jsonNode("""
+ "resolution" to PropertyDefinition().apply {
+ this.type = "json"
+ this.value = JacksonUtils.jsonNode(
+ """
{
"get_attribute":[
"resource-assignment",
"a-key"
]
}
- """.trimIndent())
- }
+ """.trimIndent()
+ )
+ }
)
val result = bluePrintRuntimeService.resolvePropertyDefinitions("workflow", "WORKFLOW", propertyDefinitions)
import kotlin.test.assertNotNull
class BluePrintWorkflowServiceTest {
+
@Test
fun testSimpleFlow() {
runBlocking {
}
override suspend fun prepareNodeExecutionMessage(node: Graph.Node):
- NodeExecuteMessage<String, String> {
- return NodeExecuteMessage(node, "$node Input", "")
- }
+ NodeExecuteMessage<String, String> {
+ return NodeExecuteMessage(node, "$node Input", "")
+ }
override suspend fun executeNode(
node: Graph.Node,
class TopologicalSortingUtilsTest {
private val log = LoggerFactory.getLogger(TopologicalSortingUtilsTest::class.java)
+
@Test
fun testSorting() {
val graph: TopologicalSortingUtils<String> = TopologicalSortingUtils()
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprints</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>modules-blueprints</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
- <name>Controller Blueprints Proto</name>
- <description>Controller Blueprints Proto</description>
+ <name>MS Blueprints Processor Modules - Blueprints - Blueprints Proto</name>
<properties>
<sonar.skip>true</sonar.skip>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
+ <!--TODO: check latest version for protoc 3.13.0-->
<protocArtifact>
com.google.protobuf:protoc:3.10.0:exe:${os.detected.classifier}
</protocArtifact>
<protoSourceRoot>${project.basedir}/../../../../../components/model-catalog/proto-definition/proto
</protoSourceRoot>
- <jvmTarget>11</jvmTarget>
</configuration>
<executions>
<execution>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprints</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>modules-blueprints</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-validation</artifactId>
- <name>Controller Blueprints Validation Service</name>
+ <name>MS Blueprints Processor Modules - Blueprints - Blueprints Validation Service</name>
<dependencies>
<dependency>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>resource-dict</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>resource-dict</artifactId>
</dependency>
<!--Testing dependencies-->
val capabilityDefinition = nodeType.capabilities?.get(capabilityName)
?: throw BluePrintException(
"Failed to get NodeTemplate($nodeTemplateName) capability definition ($capabilityName) " +
- "from NodeType(${nodeTemplate.type})"
+ "from NodeType(${nodeTemplate.type})"
)
validateCapabilityAssignment(nodeTemplateName, capabilityName, capabilityDefinition, capabilityAssignment)
val requirementDefinition = nodeType.requirements?.get(requirementName)
?: throw BluePrintException(
"Failed to get NodeTemplate($nodeTemplateName) requirement definition ($requirementName) from" +
- " NodeType(${nodeTemplate.type})"
+ " NodeType(${nodeTemplate.type})"
)
// Validate Requirement Assignment
validateRequirementAssignment(nodeTemplateName, requirementName, requirementDefinition, requirementAssignment)
val relationShipNodeTemplate = bluePrintContext.serviceTemplate.topologyTemplate?.nodeTemplates?.get(requirementNodeTemplateName)
?: throw BluePrintException(
"Failed to get requirement NodeTemplate($requirementNodeTemplateName)'s " +
- "for NodeTemplate($nodeTemplateName) requirement($requirementAssignmentName)"
+ "for NodeTemplate($nodeTemplateName) requirement($requirementAssignmentName)"
)
relationShipNodeTemplate.capabilities?.get(capabilityName)
?: throw BluePrintException(
"Failed to get requirement NodeTemplate($requirementNodeTemplateName)'s " +
- "capability($capabilityName) for NodeTemplate ($nodeTemplateName)'s requirement($requirementAssignmentName)"
+ "capability($capabilityName) for NodeTemplate ($nodeTemplateName)'s requirement($requirementAssignmentName)"
)
}
val interfaceDefinition = nodeType.interfaces?.get(interfaceAssignmentName)
?: throw BluePrintException(
"Failed to get NodeTemplate($nodeTemplateName) interface definition ($interfaceAssignmentName) from" +
- " NodeType(${nodeTemplate.type})"
+ " NodeType(${nodeTemplate.type})"
)
validateInterfaceAssignment(
log.debug(
"Validation NodeTemplate($nodeTemplateName) Interface($interfaceAssignmentName) Operation " +
- "($operationAssignmentName)"
+ "($operationAssignmentName)"
)
val inputs = operationAssignments.inputs
val propertyDefinition = operationDefinition.inputs?.get(propertyName)
?: throw BluePrintException(
"Failed to get NodeTemplate($nodeTemplateName) operation " +
- "definition ($operationAssignmentName) property definition($propertyName)"
+ "definition ($operationAssignmentName) property definition($propertyName)"
)
// Check the property values with property definition
propertyAssignmentValidationUtils
val propertyDefinition = operationDefinition.outputs?.get(propertyName)
?: throw BluePrintException(
"Failed to get NodeTemplate($nodeTemplateName) operation definition ($operationAssignmentName) " +
- "output property definition($propertyName)"
+ "output property definition($propertyName)"
)
// Check the property values with property definition
propertyAssignmentValidationUtils
relationShipNodeType.capabilities?.get(capabilityName)
?: throw BluePrintException(
"failed to get requirement NodeType($requirementNodeTypeName)'s " +
- "capability($nodeTypeName) for NodeType ($capabilityName)'s requirement($requirementDefinitionName) "
+ "capability($nodeTypeName) for NodeType ($capabilityName)'s requirement($requirementDefinitionName) "
)
}
class BluePrintTypeValidatorServiceImpl : BluePrintTypeValidatorService {
companion object {
+
const val PREFIX_DEFAULT = "default"
}
check(
nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW ||
- nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_COMPONENT
+ nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_COMPONENT
) {
"NodeType(${nodeTemplate.type}) derived from is '$nodeTypeDerivedFrom', Expected " +
- "'${BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW}' or '${BluePrintConstants.MODEL_TYPE_NODE_COMPONENT}'"
+ "'${BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW}' or '${BluePrintConstants.MODEL_TYPE_NODE_COMPONENT}'"
}
} catch (e: Exception) {
bluePrintRuntimeService.getBluePrintError()
.addError(
"Failed to validate Workflow($workflowName)'s step($stepName)'s " +
- "definition", paths.joinToString(BluePrintConstants.PATH_DIVIDER), e.message!!
+ "definition",
+ paths.joinToString(BluePrintConstants.PATH_DIVIDER), e.message!!
)
}
}
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>modules</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-modules</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <artifactId>blueprints</artifactId>
+ <artifactId>modules-blueprints</artifactId>
<packaging>pom</packaging>
- <name>Blueprints POM</name>
- <description>Blueprints POM</description>
+ <name>MS Blueprints Processor Modules - Blueprints</name>
<modules>
<module>blueprint-core</module>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprints</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>modules-blueprints</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>resource-dict</artifactId>
- <name>Controller Blueprints Resource Dictionary</name>
+ <name>MS Blueprints Processor Modules - Blueprints - Resource Dictionary</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
dictionaryName = $dictionaryName
dictionarySource = $dictionarySource
]
- """.trimIndent()
+ """.trimIndent()
}
}
data class KeyIdentifier(val name: String, val value: JsonNode)
data class DictionaryMetadataEntry(val name: String, val value: String)
+
/**
* Data class for exposing summary of resource resolution
*/
@JsonProperty("message")
val message: String
)
+
/**
* Interface for Source Definitions (ex Input Source,
* Default Source, Database Source, Rest Sources, etc)
interface ResourceSource : Serializable
open class ResourceSourceMapping {
+
lateinit var resourceSourceMappings: MutableMap<String, String>
}
for (resourceAssignment in vs) {
s.append(
"(" + resourceAssignment.dictionaryName + ":" + resourceAssignment.name +
- "),"
+ "),"
)
}
s.append("]")
for (resourceAssignment in vs) {
s.append(
"(" + resourceAssignment.dictionaryName + ":" + resourceAssignment.name +
- "),"
+ "),"
)
}
s.append("]")
} else if (CollectionUtils.isNotEmpty(resourceAssignment.dependencies)) {
for (dependency in resourceAssignment.dependencies!!) {
val ra = resourceAssignmentMap[dependency]
- ?: throw BluePrintProcessorException("Couldn't get Resource Assignment dependency " +
- "Key($dependency)")
+ ?: throw BluePrintProcessorException(
+ "Couldn't get Resource Assignment dependency " +
+ "Key($dependency)"
+ )
topologySorting.add(ra, resourceAssignment)
}
} else {
import java.io.File
object ResourceDictionaryUtils {
+
private val log = LoggerFactory.getLogger(ResourceDictionaryUtils::class.java)
@JvmStatic
public void testDictionaryDefinitionInputSource() {
String fileName = basePath + "/input-source.json";
- ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
+ ResourceDefinition resourceDefinition =
+ JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
Assert.assertNotNull("Failed to populate dictionaryDefinition for input type", resourceDefinition);
}
public void testDictionaryDefinitionDefaultSource() {
String fileName = basePath + "/default-source.json";
- ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
+ ResourceDefinition resourceDefinition =
+ JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
Assert.assertNotNull("Failed to populate dictionaryDefinition for default type", resourceDefinition);
}
public void testDictionaryDefinitionDBSource() {
String fileName = basePath + "/db-source.json";
- ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
+ ResourceDefinition resourceDefinition =
+ JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
Assert.assertNotNull("Failed to populate dictionaryDefinition for processor-db type", resourceDefinition);
}
@Test
public void testDictionaryDefinitionMDSALSource() {
String fileName = basePath + "/mdsal-source.json";
- ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
+ ResourceDefinition resourceDefinition =
+ JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
Assert.assertNotNull("Failed to populate dictionaryDefinition for mdsal type", resourceDefinition);
}
class ResourceAssignmentValidationServiceTest {
private val log = LoggerFactory.getLogger(ResourceAssignmentValidationServiceTest::class.java)
+
@Before
fun setUp() {
// Setup dummy Source Instance Mapping
@Test
public void testProcess() {
- List<ResourceAssignment> assignments = JacksonUtils.Companion.getListFromClassPathFile("validation/success.json", ResourceAssignment.class);
+ List<ResourceAssignment> assignments =
+ JacksonUtils.Companion.getListFromClassPathFile("validation/success.json", ResourceAssignment.class);
Assert.assertNotNull("failed to get ResourceAssignment from validation/success.json ", assignments);
BulkResourceSequencingUtils.process(assignments);
}
-}
\ No newline at end of file
+}
resourceDefinition.setSources(sources);
// To Check Empty Source
ResourceDictionaryUtils.populateSourceMapping(resourceAssignment, resourceDefinition);
- Assert.assertEquals("Expected Empty source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, resourceAssignment.getDictionarySource());
+ Assert.assertEquals("Expected Empty source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT,
+ resourceAssignment.getDictionarySource());
// To Check First Source
resourceAssignment.setDictionarySource(null);
sources.put(ResourceDictionaryConstants.SOURCE_DEFAULT, new NodeTemplate());
ResourceDictionaryUtils.populateSourceMapping(resourceAssignment, resourceDefinition);
- Assert.assertEquals("Expected First source Default, but.",
- ResourceDictionaryConstants.SOURCE_DEFAULT,
+ Assert.assertEquals("Expected First source Default, but.", ResourceDictionaryConstants.SOURCE_DEFAULT,
resourceAssignment.getDictionarySource());
// To Check Assigned Source
resourceAssignment.setDictionarySource(ResourceDictionaryConstants.PROCESSOR_DB);
ResourceDictionaryUtils.populateSourceMapping(resourceAssignment, resourceDefinition);
- Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.PROCESSOR_DB, resourceAssignment.getDictionarySource());
+ Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.PROCESSOR_DB,
+ resourceAssignment.getDictionarySource());
}
@Test
public void testFindFirstSource() {
- //To check if Empty Source
+ // To check if Empty Source
Map<String, NodeTemplate> sources = new HashMap<>();
String firstSource = ResourceDictionaryUtils.findFirstSource(sources);
Assert.assertNull("Source populated, which is not expected.", firstSource);
// TO check the multiple Source
sources.put(ResourceDictionaryConstants.PROCESSOR_DB, new NodeTemplate());
String multipleFirstSource = ResourceDictionaryUtils.findFirstSource(sources);
- Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, multipleFirstSource);
+ Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT,
+ multipleFirstSource);
}
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>db-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor DB Lib</name>
- <description>Blueprints Processor DB Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - DB Lib</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-validation</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-validation</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
class DBLibConstants {
companion object {
+
const val PREFIX_DB: String = "blueprintsprocessor.db"
// list of database
package org.onap.ccsdk.cds.blueprintsprocessor.db
open class DBDataSourceProperties {
+
var type: String = DBLibConstants.MARIA_DB
lateinit var url: String
lateinit var username: String
}
open class PrimaryDataSourceProperties : DBDataSourceProperties() {
+
lateinit var hibernateHbm2ddlAuto: String
lateinit var hibernateDDLAuto: String
lateinit var hibernateNamingStrategy: String
}
open class MariaDataSourceProperties : DBDataSourceProperties() {
+
lateinit var hibernateHbm2ddlAuto: String
lateinit var hibernateDDLAuto: String
lateinit var hibernateNamingStrategy: String
}
open class MySqlDataSourceProperties : DBDataSourceProperties() {
+
lateinit var hibernateHbm2ddlAuto: String
lateinit var hibernateDDLAuto: String
lateinit var hibernateNamingStrategy: String
class BluePrintDBLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) {
fun JdbcTemplate(jsonNode: JsonNode): BluePrintDBLibGenericService =
- blueprintDBDataSourceService(dBDataSourceProperties(jsonNode))
+ blueprintDBDataSourceService(dBDataSourceProperties(jsonNode))
fun JdbcTemplate(selector: String): BluePrintDBLibGenericService =
- blueprintDBDataSourceService(dBDataSourceProperties("blueprintsprocessor.db.$selector"))
+ blueprintDBDataSourceService(dBDataSourceProperties("blueprintsprocessor.db.$selector"))
private fun dBDataSourceProperties(jsonNode: JsonNode): DBDataSourceProperties =
- when (val type = jsonNode.get("type").textValue()) {
- MYSQL_DB -> JacksonUtils.readValue(jsonNode, MySqlDataSourceProperties::class.java)
- MARIA_DB -> JacksonUtils.readValue(jsonNode, MariaDataSourceProperties::class.java)
- else -> {
- throw BluePrintProcessorException(
- "DB type ($type) is not supported. Valid types: $MARIA_DB, $MYSQL_DB")
- }
- }!!
+ when (val type = jsonNode.get("type").textValue()) {
+ MYSQL_DB -> JacksonUtils.readValue(jsonNode, MySqlDataSourceProperties::class.java)
+ MARIA_DB -> JacksonUtils.readValue(jsonNode, MariaDataSourceProperties::class.java)
+ else -> {
+ throw BluePrintProcessorException(
+ "DB type ($type) is not supported. Valid types: $MARIA_DB, $MYSQL_DB"
+ )
+ }
+ }!!
private fun dBDataSourceProperties(prefix: String): DBDataSourceProperties =
- bluePrintPropertiesService.propertyBeanType("$prefix.type", String::class.java).let {
- return when (it) {
- MARIA_DB, PROCESSOR_DB -> mariaDBConnectionProperties(prefix)
- MYSQL_DB -> mySqlDBConnectionProperties(prefix)
- else -> {
- throw BluePrintProcessorException(
- "DB type ($it) is not supported. Valid types: $MARIA_DB, $MYSQL_DB, $PROCESSOR_DB")
- }
+ bluePrintPropertiesService.propertyBeanType("$prefix.type", String::class.java).let {
+ return when (it) {
+ MARIA_DB, PROCESSOR_DB -> mariaDBConnectionProperties(prefix)
+ MYSQL_DB -> mySqlDBConnectionProperties(prefix)
+ else -> {
+ throw BluePrintProcessorException(
+ "DB type ($it) is not supported. Valid types: $MARIA_DB, $MYSQL_DB, $PROCESSOR_DB"
+ )
}
}
+ }
private fun blueprintDBDataSourceService(dBConnetionProperties: DBDataSourceProperties): BluePrintDBLibGenericService =
- when (dBConnetionProperties) {
- is MariaDataSourceProperties -> MariaDatabaseConfiguration(dBConnetionProperties)
- is MySqlDataSourceProperties -> MySqlDatabaseConfiguration(dBConnetionProperties)
- else -> throw BluePrintProcessorException(
- "Failed to create db configuration for ${dBConnetionProperties.url}")
- }
+ when (dBConnetionProperties) {
+ is MariaDataSourceProperties -> MariaDatabaseConfiguration(dBConnetionProperties)
+ is MySqlDataSourceProperties -> MySqlDatabaseConfiguration(dBConnetionProperties)
+ else -> throw BluePrintProcessorException(
+ "Failed to create db configuration for ${dBConnetionProperties.url}"
+ )
+ }
private fun mySqlDBConnectionProperties(prefix: String): MySqlDataSourceProperties =
- bluePrintPropertiesService.propertyBeanType(prefix, MySqlDataSourceProperties::class.java)
+ bluePrintPropertiesService.propertyBeanType(prefix, MySqlDataSourceProperties::class.java)
private fun mariaDBConnectionProperties(prefix: String): MariaDataSourceProperties =
- bluePrintPropertiesService.propertyBeanType(prefix, MariaDataSourceProperties::class.java)
+ bluePrintPropertiesService.propertyBeanType(prefix, MariaDataSourceProperties::class.java)
}
import javax.sql.DataSource
class MySqlDatabaseConfiguration(private val mySqlDataSourceProperties: MySqlDataSourceProperties) : BluePrintDBLibGenericService {
+
override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate {
return mySqlNamedParameterJdbcTemplate(mySqlDataSource())
}
var blueprintModelContent: BlueprintModelContent? = null
companion object {
+
private const val serialVersionUID = 1L
}
}
override fun toString(): String {
return "[" + "id = " + id +
- ", name = " + name +
- ", contentType = " + contentType +
- "]"
+ ", name = " + name +
+ ", contentType = " + contentType +
+ "]"
}
override fun equals(o: Any?): Boolean {
return false
}
val blueprintModelContent = o as BlueprintModelContent?
- return (id == blueprintModelContent!!.id && name == blueprintModelContent.name &&
- contentType == blueprintModelContent.contentType)
+ return (
+ id == blueprintModelContent!!.id && name == blueprintModelContent.name &&
+ contentType == blueprintModelContent.contentType
+ )
}
override fun hashCode(): Int {
var tags: String? = null
companion object {
+
const val serialversionuid = 1L
}
}
* @return B?
*/
fun findTopByBlueprintModelAndContentType(blueprintModel: BlueprintModel, contentType: String):
- BlueprintModelContent?
+ BlueprintModelContent?
/**
* This is a findByBlueprintModelAndContentType method
* @return List<B>
*/
fun findByBlueprintModelAndContentType(blueprintModel: BlueprintModel, contentType: String):
- List<BlueprintModelContent>
+ List<BlueprintModelContent>
/**
* This is a findByBlueprintModel method
*
* @param id id
* @return Optional<BlueprintModelSearch>
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
fun findById(id: String): BlueprintModelSearch?
/**
* This is a findAll method
* @return List<BlueprintModelSearch>
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
override fun findAll(): List<BlueprintModelSearch>
/**
* @param artifactName artifactName
* @param artifactVersion artifactVersion
* @return Optional<AsdcArtifacts>
- </AsdcArtifacts> */
+ </AsdcArtifacts> */
fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModelSearch?
/**
*
* @param tags
* @return Optional<BlueprintModelSearch>
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
fun findByTagsContainingIgnoreCase(tags: String): List<BlueprintModelSearch>
/**
* @param artifactVersion
* @param artifactType
* @return Optional<BlueprintModelSearch>
- </BlueprintModelSearch>
+ </BlueprintModelSearch>
*/
fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(
updatedBy: String,
deleteNBDir(deployFile.absolutePath)
throw BluePrintProcessorException(
"failed to get get cba file name($name), version($version) from db" +
- " : ${e.message}"
+ " : ${e.message}"
)
} finally {
deleteNBDir(cbaFile.parentFile.absolutePath)
blueprintModel.artifactVersion = artifactVersion
blueprintModel.updatedBy = metadata[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]!!
blueprintModel.tags = metadata[BluePrintConstants.METADATA_TEMPLATE_TAGS]!!
- val description = if (null != metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION] else ""
+ val description =
+ if (null != metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION] else ""
blueprintModel.artifactDescription = description
val blueprintModelContent = BlueprintModelContent()
blueprintModelRepository.saveAndFlush(blueprintModel)
} catch (ex: DataIntegrityViolationException) {
throw BluePrintException(
- ErrorCode.CONFLICT_ADDING_RESOURCE.value, "The blueprint entry " +
- "is already exist in database: ${ex.message}", ex
+ ErrorCode.CONFLICT_ADDING_RESOURCE.value,
+ "The blueprint entry " +
+ "is already exist in database: ${ex.message}",
+ ex
)
}
}
@EnableAutoConfiguration
@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor"])
@ContextConfiguration(
- classes = [BlueprintProcessorCatalogServiceImpl::class, BluePrintCoreConfiguration::class,
- MockBlueprintProcessorCatalogServiceImpl::class]
+ classes = [
+ BlueprintProcessorCatalogServiceImpl::class, BluePrintCoreConfiguration::class,
+ MockBlueprintProcessorCatalogServiceImpl::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class BlueprintProcessorCatalogServiceImplTest {
File(
blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath +
"/baseconfiguration"
- ).deleteRecursively(), "Couldn't get blueprint archive " +
+ ).deleteRecursively(),
+ "Couldn't get blueprint archive " +
"${blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath}/baseconfiguration " +
"from data base."
)
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>dmaap-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Dmaap Lib</name>
- <description>Blueprints Processor Dmaap Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - Dmaap Lib</name>
<dependencies>
<dependency>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
</dependencies>
* Representation of DMAAP client service for AAF auth type.
*/
class AafAuthDmaapClientService(
- private val clientProps:
- AafAuthDmaapClientProperties
+ private val clientProps: AafAuthDmaapClientProperties
) :
BluePrintDmaapClientService {
} catch (e: IOException) {
log.warn(
"Unable to cleanly close the connection from the " +
- "client $client", e
+ "client $client",
+ e
)
}
}
class DmaapLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_DMAAP_LIB_PROPERTY = "blueprint" +
- "-dmaap-lib-property-service"
+ "-dmaap-lib-property-service"
const val TYPE_HTTP_NO_AUTH = "HTTPNOAUTH"
const val TYPE_HTTP_AAF_AUTH = "HTTPAAF"
}
* node.
*/
fun blueprintDmaapClientService(jsonNode: JsonNode):
- BluePrintDmaapClientService {
- val dmaapProps = dmaapClientProperties(jsonNode)
- return blueprintDmaapClientService(dmaapProps)
- }
+ BluePrintDmaapClientService {
+ val dmaapProps = dmaapClientProperties(jsonNode)
+ return blueprintDmaapClientService(dmaapProps)
+ }
/**
* Returns the DMAAP client by providing the input properties as a
* selector string.
*/
fun blueprintDmaapClientService(selector: String):
- BluePrintDmaapClientService {
- val prefix = "blueprintsprocessor.dmaapclient.$selector"
- val dmaapProps = dmaapClientProperties(prefix)
- return blueprintDmaapClientService(dmaapProps)
- }
+ BluePrintDmaapClientService {
+ val prefix = "blueprintsprocessor.dmaapclient.$selector"
+ val dmaapProps = dmaapClientProperties(prefix)
+ return blueprintDmaapClientService(dmaapProps)
+ }
/**
* Returns the DMAAP client properties from the type of connection it
else -> {
throw BluePrintProcessorException(
"DMAAP adaptor($type) is " +
- "not supported"
+ "not supported"
)
}
}
else -> {
throw BluePrintProcessorException(
"DMAAP adaptor($type) is " +
- "not supported"
+ "not supported"
)
}
}
* Returns DMAAP client service according to the type of client properties.
*/
private fun blueprintDmaapClientService(clientProps: DmaapClientProperties):
- BluePrintDmaapClientService {
- when (clientProps) {
- is HttpNoAuthDmaapClientProperties -> {
- return HttpNoAuthDmaapClientService(clientProps)
- }
-
- is AafAuthDmaapClientProperties -> {
- return AafAuthDmaapClientService(clientProps)
- }
-
- else -> {
- throw BluePrintProcessorException(
- "Unable to get the DMAAP " +
+ BluePrintDmaapClientService {
+ when (clientProps) {
+ is HttpNoAuthDmaapClientProperties -> {
+ return HttpNoAuthDmaapClientService(clientProps)
+ }
+
+ is AafAuthDmaapClientProperties -> {
+ return AafAuthDmaapClientService(clientProps)
+ }
+
+ else -> {
+ throw BluePrintProcessorException(
+ "Unable to get the DMAAP " +
"client"
- )
+ )
+ }
}
}
- }
/**
* Parses the event.properties file which contains the default values for
*/
class HttpNoAuthDmaapClientService(
private val clientProps:
- HttpNoAuthDmaapClientProperties
+ HttpNoAuthDmaapClientProperties
) :
BluePrintDmaapClientService {
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextConfiguration(
- classes = [BluePrintDmaapLibConfiguration::class, TestController::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintDmaapLibConfiguration::class, TestController::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
- properties = ["server.port=9111",
+ properties = [
+ "server.port=9111",
"blueprintsprocessor.dmaapclient.aai.topic=cds_aai",
"blueprintsprocessor.dmaapclient.aai.type=HTTPNOAUTH",
"blueprintsprocessor.dmaapclient.aai.host=127.0.0.1:9111",
"blueprintsprocessor.dmaapclient.multi.topic=cds_multi1,cds_multi2",
"blueprintsprocessor.dmaapclient.multi.type=HTTPNOAUTH",
- "blueprintsprocessor.dmaapclient.multi.host=127.0.0.1:9111"]
+ "blueprintsprocessor.dmaapclient.multi.host=127.0.0.1:9111"
+ ]
)
class TestDmaapEventPublisher {
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
fun testEventPropertiesWithSingleMsg() {
val dmaapClient = dmaapService.blueprintDmaapClientService("aai")
val str: String = "{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
dmaapClient.sendMessage(str)
val msgs = dmaapClient.close(2)
assertEquals(msgs!!.size, 1)
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
@Test
fun testMultiTopicPropertiesWithJsonInput() {
val jsonString = "{\n" +
- " \"topic\" : \"cds_json1,cds_json2\",\n" +
- " \"type\" : \"HTTPNOAUTH\",\n" +
- " \"host\" : \"127.0.0.1:9111\"\n" +
- "}"
+ " \"topic\" : \"cds_json1,cds_json2\",\n" +
+ " \"type\" : \"HTTPNOAUTH\",\n" +
+ " \"host\" : \"127.0.0.1:9111\"\n" +
+ "}"
val mapper = ObjectMapper()
val node = mapper.readTree(jsonString)
val strList = mutableListOf<String>()
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
strList.add(
"{\n" +
- " \"a\" : \"second\"\n" +
- "}"
+ " \"a\" : \"second\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
)
assertNotNull(properties, "failed to create property bean")
assertNotNull(
- properties.host, "failed to get url property" +
- " in property bean"
+ properties.host,
+ "failed to get url property" +
+ " in property bean"
)
}
*/
@PostMapping(path = ["/{topic}"])
fun postTopic(@PathVariable(value = "topic") topic: String):
- ResponseEntity<Any> {
- var a = "{\n" +
+ ResponseEntity<Any> {
+ var a = "{\n" +
" \"message\" : \"The message is published into $topic " +
"topic\"\n" +
"}"
- return ResponseEntity(a, HttpStatus.OK)
- }
+ return ResponseEntity(a, HttpStatus.OK)
+ }
}
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>grpc-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor GRPC Lib</name>
- <description>Blueprints Processor GRPC Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - GRPC Lib</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
class GRPCLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_GRPC_LIB_PROPERTY = "blueprint-grpc-lib-property-service"
const val PROPERTY_GRPC_CLIENT_PREFIX = "blueprintsprocessor.grpcclient."
const val PROPERTY_GRPC_SERVER_PREFIX = "blueprintsprocessor.grpcserver."
}
open class TokenAuthGrpcServerProperties : GrpcServerProperties() {
+
lateinit var token: String
}
open class TLSAuthGrpcServerProperties : GrpcServerProperties() {
+
lateinit var certChain: String
lateinit var privateKey: String
+
/** Below Used only for Mutual TLS */
var trustCertCollection: String? = null
}
}
open class TokenAuthGrpcClientProperties : GrpcClientProperties() {
+
lateinit var token: String
}
open class TLSAuthGrpcClientProperties : GrpcClientProperties() {
+
var trustCertCollection: String? = null
+
/** Below Used only for Mutual TLS */
var clientCertChain: String? = null
var clientPrivateKey: String? = null
}
open class BasicAuthGrpcClientProperties : GrpcClientProperties() {
+
lateinit var username: String
lateinit var password: String
}
import org.onap.ccsdk.cds.controllerblueprints.core.logger
class GrpcClientLoggingInterceptor : ClientInterceptor {
+
val log = logger(GrpcClientLoggingInterceptor::class)
val loggingService = GrpcLoggerService()
import org.slf4j.MDC
class GrpcServerLoggingInterceptor : ServerInterceptor {
+
val log = logger(GrpcServerLoggingInterceptor::class)
val loggingService = GrpcLoggerService()
):
ServerCall.Listener<ReqT> {
- val forwardingServerCall = object : ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) {
- override fun sendHeaders(responseHeaders: Metadata) {
- loggingService.grpResponding(requestHeaders, responseHeaders)
- super.sendHeaders(responseHeaders)
+ val forwardingServerCall = object : ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) {
+ override fun sendHeaders(responseHeaders: Metadata) {
+ loggingService.grpResponding(requestHeaders, responseHeaders)
+ super.sendHeaders(responseHeaders)
+ }
}
- }
- return object :
- ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>(
- next.startCall(forwardingServerCall, requestHeaders)
- ) {
+ return object :
+ ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>(
+ next.startCall(forwardingServerCall, requestHeaders)
+ ) {
- override fun onMessage(message: ReqT) {
- /** Get the requestId, SubRequestId and Originator Id and set in MDS context
- * If you are using other GRPC services, Implement own Logging Interceptors to get tracing.
- * */
- when (message) {
- is ExecutionServiceInput -> {
- val commonHeader = message.commonHeader
- ?: throw BluePrintProcessorException("missing common header in request")
- loggingService.grpcRequesting(call, commonHeader, next)
- }
- is BluePrintUploadInput -> {
- val commonHeader = message.commonHeader
- ?: throw BluePrintProcessorException("missing common header in request")
- loggingService.grpcRequesting(call, commonHeader, next)
- }
- is BluePrintDownloadInput -> {
- val commonHeader = message.commonHeader
- ?: throw BluePrintProcessorException("missing common header in request")
- loggingService.grpcRequesting(call, commonHeader, next)
- }
- is BluePrintRemoveInput -> {
- val commonHeader = message.commonHeader
- ?: throw BluePrintProcessorException("missing common header in request")
- loggingService.grpcRequesting(call, commonHeader, next)
- }
- else -> {
- loggingService.grpcRequesting(call, requestHeaders, next)
+ override fun onMessage(message: ReqT) {
+ /** Get the requestId, SubRequestId and Originator Id and set in MDS context
+ * If you are using other GRPC services, Implement own Logging Interceptors to get tracing.
+ * */
+ when (message) {
+ is ExecutionServiceInput -> {
+ val commonHeader = message.commonHeader
+ ?: throw BluePrintProcessorException("missing common header in request")
+ loggingService.grpcRequesting(call, commonHeader, next)
+ }
+ is BluePrintUploadInput -> {
+ val commonHeader = message.commonHeader
+ ?: throw BluePrintProcessorException("missing common header in request")
+ loggingService.grpcRequesting(call, commonHeader, next)
+ }
+ is BluePrintDownloadInput -> {
+ val commonHeader = message.commonHeader
+ ?: throw BluePrintProcessorException("missing common header in request")
+ loggingService.grpcRequesting(call, commonHeader, next)
+ }
+ is BluePrintRemoveInput -> {
+ val commonHeader = message.commonHeader
+ ?: throw BluePrintProcessorException("missing common header in request")
+ loggingService.grpcRequesting(call, commonHeader, next)
+ }
+ else -> {
+ loggingService.grpcRequesting(call, requestHeaders, next)
+ }
}
+ super.onMessage(message)
}
- super.onMessage(message)
- }
- override fun onComplete() {
- MDC.clear()
- super.onComplete()
- }
+ override fun onComplete() {
+ MDC.clear()
+ super.onComplete()
+ }
- override fun onCancel() {
- MDC.clear()
- super.onCancel()
+ override fun onCancel() {
+ MDC.clear()
+ super.onCancel()
+ }
}
}
- }
}
private fun blueprintGrpcServerService(grpcServerProperties: GrpcServerProperties):
BluePrintGrpcServerService {
- when (grpcServerProperties) {
- is TLSAuthGrpcServerProperties -> {
- return TLSAuthGrpcServerService(grpcServerProperties)
- }
- else -> {
- throw BluePrintProcessorException("couldn't get grpc client service for properties $grpcServerProperties")
+ when (grpcServerProperties) {
+ is TLSAuthGrpcServerProperties -> {
+ return TLSAuthGrpcServerService(grpcServerProperties)
+ }
+ else -> {
+ throw BluePrintProcessorException("couldn't get grpc client service for properties $grpcServerProperties")
+ }
}
}
- }
/** GRPC Client Lib Property Service */
fun blueprintGrpcClientService(grpcClientProperties: GrpcClientProperties):
BluePrintGrpcClientService {
- return when (grpcClientProperties) {
- is TokenAuthGrpcClientProperties -> {
- TokenAuthGrpcClientService(grpcClientProperties)
- }
- is TLSAuthGrpcClientProperties -> {
- TLSAuthGrpcClientService(grpcClientProperties)
- }
- is BasicAuthGrpcClientProperties -> {
- BasicAuthGrpcClientService(grpcClientProperties)
- }
- else -> {
- throw BluePrintProcessorException("couldn't get grpc service for type(${grpcClientProperties.type})")
+ return when (grpcClientProperties) {
+ is TokenAuthGrpcClientProperties -> {
+ TokenAuthGrpcClientService(grpcClientProperties)
+ }
+ is TLSAuthGrpcClientProperties -> {
+ TLSAuthGrpcClientService(grpcClientProperties)
+ }
+ is BasicAuthGrpcClientProperties -> {
+ BasicAuthGrpcClientService(grpcClientProperties)
+ }
+ else -> {
+ throw BluePrintProcessorException("couldn't get grpc service for type(${grpcClientProperties.type})")
+ }
}
}
- }
private fun tokenAuthGrpcClientProperties(prefix: String): TokenAuthGrpcClientProperties {
return bluePrintPropertiesService.propertyBeanType(prefix, TokenAuthGrpcClientProperties::class.java)
import io.grpc.netty.NettyServerBuilder
interface BluePrintGrpcServerService {
+
fun serverBuilder(): NettyServerBuilder
}
interface BluePrintGrpcClientService {
+
suspend fun channel(): ManagedChannel
}
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintGrpcLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintGrpcLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.grpcclient.sample.type=basic-auth",
- "blueprintsprocessor.grpcclient.sample.host=127.0.0.1",
- "blueprintsprocessor.grpcclient.sample.port=50505",
- "blueprintsprocessor.grpcclient.sample.username=sampleuser",
- "blueprintsprocessor.grpcclient.sample.password=sampleuser",
-
- "blueprintsprocessor.grpcclient.token.type=token-auth",
- "blueprintsprocessor.grpcclient.token.host=127.0.0.1",
- "blueprintsprocessor.grpcclient.token.port=50505",
- "blueprintsprocessor.grpcclient.token.username=sampleuser",
- "blueprintsprocessor.grpcclient.token.password=sampleuser",
-
- "blueprintsprocessor.grpcserver.tls-sample.type=tls-auth",
- "blueprintsprocessor.grpcserver.tls-sample.port=50505",
- "blueprintsprocessor.grpcserver.tls-sample.certChain=server1.pem",
- "blueprintsprocessor.grpcserver.tls-sample.privateKey=server1.key",
- "blueprintsprocessor.grpcserver.tls-sample.trustCertCollection=ca.pem",
-
- "blueprintsprocessor.grpcclient.tls-sample.type=tls-auth",
- "blueprintsprocessor.grpcclient.tls-sample.host=127.0.0.1",
- "blueprintsprocessor.grpcclient.tls-sample.port=50505",
- "blueprintsprocessor.grpcclient.tls-sample.trustCertCollection=ca.pem",
- "blueprintsprocessor.grpcclient.tls-sample.clientCertChain=client.pem",
- "blueprintsprocessor.grpcclient.tls-sample.clientPrivateKey=client.key"
- ]
+ [
+ "blueprintsprocessor.grpcclient.sample.type=basic-auth",
+ "blueprintsprocessor.grpcclient.sample.host=127.0.0.1",
+ "blueprintsprocessor.grpcclient.sample.port=50505",
+ "blueprintsprocessor.grpcclient.sample.username=sampleuser",
+ "blueprintsprocessor.grpcclient.sample.password=sampleuser",
+
+ "blueprintsprocessor.grpcclient.token.type=token-auth",
+ "blueprintsprocessor.grpcclient.token.host=127.0.0.1",
+ "blueprintsprocessor.grpcclient.token.port=50505",
+ "blueprintsprocessor.grpcclient.token.username=sampleuser",
+ "blueprintsprocessor.grpcclient.token.password=sampleuser",
+
+ "blueprintsprocessor.grpcserver.tls-sample.type=tls-auth",
+ "blueprintsprocessor.grpcserver.tls-sample.port=50505",
+ "blueprintsprocessor.grpcserver.tls-sample.certChain=server1.pem",
+ "blueprintsprocessor.grpcserver.tls-sample.privateKey=server1.key",
+ "blueprintsprocessor.grpcserver.tls-sample.trustCertCollection=ca.pem",
+
+ "blueprintsprocessor.grpcclient.tls-sample.type=tls-auth",
+ "blueprintsprocessor.grpcclient.tls-sample.host=127.0.0.1",
+ "blueprintsprocessor.grpcclient.tls-sample.port=50505",
+ "blueprintsprocessor.grpcclient.tls-sample.trustCertCollection=ca.pem",
+ "blueprintsprocessor.grpcclient.tls-sample.clientCertChain=client.pem",
+ "blueprintsprocessor.grpcclient.tls-sample.clientPrivateKey=client.key"
+ ]
)
class BluePrintGrpcLibPropertyServiceTest {
}
class MockTLSBluePrintProcessingServer : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() {
+
override fun process(responseObserver: StreamObserver<ExecutionServiceOutput>): StreamObserver<ExecutionServiceInput> {
return object : StreamObserver<ExecutionServiceInput> {
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>message-lib</artifactId>
- <name>Blueprints Processor Messaging Lib</name>
- <description>Blueprints Processor Messaging Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - Messaging Lib</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
class MessageLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_MESSAGE_LIB_PROPERTY = "blueprint-message-lib-property-service"
const val PROPERTY_MESSAGE_CONSUMER_PREFIX = "blueprintsprocessor.messageconsumer."
const val PROPERTY_MESSAGE_PRODUCER_PREFIX = "blueprintsprocessor.messageproducer."
/** Common Properties **/
abstract class CommonProperties {
+
lateinit var type: String
lateinit var topic: String
lateinit var bootstrapServers: String
/** SSL Auth */
open class KafkaSslAuthMessageProducerProperties : KafkaBasicAuthMessageProducerProperties() {
+
lateinit var truststore: String
lateinit var truststorePassword: String
var truststoreType: String = SslConfigs.DEFAULT_SSL_TRUSTSTORE_TYPE
/** (SASL) SCRAM SSL Auth */
class KafkaScramSslAuthMessageProducerProperties : KafkaSslAuthMessageProducerProperties() {
+
var saslMechanism: String = "SCRAM-SHA-512"
lateinit var scramUsername: String
lateinit var scramPassword: String
configProps[CommonClientConfigs.SECURITY_PROTOCOL_CONFIG] = SecurityProtocol.SASL_SSL.toString()
configProps[SaslConfigs.SASL_MECHANISM] = saslMechanism
configProps[SaslConfigs.SASL_JAAS_CONFIG] = "${ScramLoginModule::class.java.canonicalName} required " +
- "username=\"${scramUsername}\" " +
- "password=\"${scramPassword}\";"
+ "username=\"${scramUsername}\" " +
+ "password=\"${scramPassword}\";"
return configProps
}
}
/** Basic Auth */
open class KafkaStreamsBasicAuthConsumerProperties : MessageConsumerProperties() {
+
lateinit var applicationId: String
var autoOffsetReset: String = "latest"
var processingGuarantee: String = StreamsConfig.EXACTLY_ONCE
/** SSL Auth */
open class KafkaStreamsSslAuthConsumerProperties : KafkaStreamsBasicAuthConsumerProperties() {
+
lateinit var truststore: String
lateinit var truststorePassword: String
var truststoreType: String = SslConfigs.DEFAULT_SSL_TRUSTSTORE_TYPE
/** (SASL) SCRAM SSL Auth */
class KafkaStreamsScramSslAuthConsumerProperties : KafkaStreamsSslAuthConsumerProperties() {
+
var saslMechanism: String = "SCRAM-SHA-512"
lateinit var scramUsername: String
lateinit var scramPassword: String
configProps[CommonClientConfigs.SECURITY_PROTOCOL_CONFIG] = SecurityProtocol.SASL_SSL.toString()
configProps[SaslConfigs.SASL_MECHANISM] = saslMechanism
configProps[SaslConfigs.SASL_JAAS_CONFIG] = "${ScramLoginModule::class.java.canonicalName} required " +
- "username=\"${scramUsername}\" " +
- "password=\"${scramPassword}\";"
+ "username=\"${scramUsername}\" " +
+ "password=\"${scramPassword}\";"
return configProps
}
}
/** Message Consumer Properties **/
/** Basic Auth */
open class KafkaBasicAuthMessageConsumerProperties : MessageConsumerProperties() {
+
lateinit var groupId: String
lateinit var clientId: String
var autoCommit: Boolean = true
/** SSL Auth */
open class KafkaSslAuthMessageConsumerProperties : KafkaBasicAuthMessageConsumerProperties() {
+
lateinit var truststore: String
lateinit var truststorePassword: String
var truststoreType: String = SslConfigs.DEFAULT_SSL_TRUSTSTORE_TYPE
/** (SASL) SCRAM SSL Auth */
class KafkaScramSslAuthMessageConsumerProperties : KafkaSslAuthMessageConsumerProperties() {
+
var saslMechanism: String = "SCRAM-SHA-512"
lateinit var scramUsername: String
lateinit var scramPassword: String
configProps[CommonClientConfigs.SECURITY_PROTOCOL_CONFIG] = SecurityProtocol.SASL_SSL.toString()
configProps[SaslConfigs.SASL_MECHANISM] = saslMechanism
configProps[SaslConfigs.SASL_JAAS_CONFIG] = "${ScramLoginModule::class.java.canonicalName} required " +
- "username=\"${scramUsername}\" " +
- "password=\"${scramPassword}\";"
+ "username=\"${scramUsername}\" " +
+ "password=\"${scramPassword}\";"
return configProps
}
}
fun kafkaSslAuth(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaSslAuthMessageProducerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaSslAuthMessageProducerProperties(block)
)
}
fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block)
)
}
}
fun BluePrintTypes.kafkaSslAuthMessageProducerProperties(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaSslAuthMessageProducerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
fun BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaScramSslAuthMessageProducerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
}
open class KafkaSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder() {
+
fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
fun truststore(truststore: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::truststore, truststore)
+ property(KafkaSslAuthMessageProducerProperties::truststore, truststore)
fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
fun truststorePassword(truststorePassword: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::truststorePassword, truststorePassword)
+ property(KafkaSslAuthMessageProducerProperties::truststorePassword, truststorePassword)
fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
fun truststoreType(truststoreType: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::truststoreType, truststoreType)
+ property(KafkaSslAuthMessageProducerProperties::truststoreType, truststoreType)
fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
fun keystore(keystore: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
+ property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
fun keystorePassword(keystorePassword: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
+ property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
fun keystoreType(keystoreType: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
+ property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
- sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
+ sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
+ property(KafkaSslAuthMessageProducerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}
class KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaSslAuthMessageProducerPropertiesAssignmentBuilder() {
+
fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
fun saslMechanism(saslMechanism: JsonNode) =
- property(KafkaScramSslAuthMessageProducerProperties::saslMechanism, saslMechanism)
+ property(KafkaScramSslAuthMessageProducerProperties::saslMechanism, saslMechanism)
fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
fun scramUsername(scramUsername: JsonNode) =
- property(KafkaScramSslAuthMessageProducerProperties::scramUsername, scramUsername)
+ property(KafkaScramSslAuthMessageProducerProperties::scramUsername, scramUsername)
fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
fun scramPassword(scramPassword: JsonNode) =
- property(KafkaScramSslAuthMessageProducerProperties::scramPassword, scramPassword)
+ property(KafkaScramSslAuthMessageProducerProperties::scramPassword, scramPassword)
}
/** Relationships Templates DSL for Message Consumer */
fun kafkaSslAuth(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block)
)
}
fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block)
)
}
fun kafkaStreamsSslAuth(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block)
)
}
fun kafkaStreamsScramSslAuth(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
property(
- BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
- BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block)
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block)
)
}
}
fun BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaSslAuthMessageConsumerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
fun BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaScramSslAuthMessageConsumerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
fun BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaStreamsSslAuthConsumerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
fun BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val assignments = KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
assignments[KafkaStreamsScramSslAuthConsumerProperties::type.name] =
- MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH.asJsonPrimitive()
+ MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH.asJsonPrimitive()
return assignments.asJsonType()
}
}
open class KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder() {
+
fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
fun truststore(truststore: JsonNode) =
- property(KafkaSslAuthMessageConsumerProperties::truststore, truststore)
+ property(KafkaSslAuthMessageConsumerProperties::truststore, truststore)
fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
fun truststorePassword(truststorePassword: JsonNode) =
- property(KafkaSslAuthMessageConsumerProperties::truststorePassword, truststorePassword)
+ property(KafkaSslAuthMessageConsumerProperties::truststorePassword, truststorePassword)
fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
fun truststoreType(truststoreType: JsonNode) =
- property(KafkaSslAuthMessageConsumerProperties::truststoreType, truststoreType)
+ property(KafkaSslAuthMessageConsumerProperties::truststoreType, truststoreType)
fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
fun keystore(keystore: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
+ property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
fun keystorePassword(keystorePassword: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
+ property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
fun keystoreType(keystoreType: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
+ property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
- sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
+ sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
- property(KafkaSslAuthMessageConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
+ property(KafkaSslAuthMessageConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}
class KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder() {
+
fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
fun saslMechanism(saslMechanism: JsonNode) =
- property(KafkaScramSslAuthMessageConsumerProperties::saslMechanism, saslMechanism)
+ property(KafkaScramSslAuthMessageConsumerProperties::saslMechanism, saslMechanism)
fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
fun scramUsername(scramUsername: JsonNode) =
- property(KafkaScramSslAuthMessageConsumerProperties::scramUsername, scramUsername)
+ property(KafkaScramSslAuthMessageConsumerProperties::scramUsername, scramUsername)
fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
fun scramPassword(scramPassword: JsonNode) =
- property(KafkaScramSslAuthMessageConsumerProperties::scramPassword, scramPassword)
+ property(KafkaScramSslAuthMessageConsumerProperties::scramPassword, scramPassword)
}
/** KafkaStreamsConsumerProperties assignment builder */
}
open class KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder() {
+
fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
fun truststore(truststore: JsonNode) =
- property(KafkaStreamsSslAuthConsumerProperties::truststore, truststore)
+ property(KafkaStreamsSslAuthConsumerProperties::truststore, truststore)
fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
fun truststorePassword(truststorePassword: JsonNode) =
- property(KafkaStreamsSslAuthConsumerProperties::truststorePassword, truststorePassword)
+ property(KafkaStreamsSslAuthConsumerProperties::truststorePassword, truststorePassword)
fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
fun truststoreType(truststoreType: JsonNode) =
- property(KafkaStreamsSslAuthConsumerProperties::truststoreType, truststoreType)
+ property(KafkaStreamsSslAuthConsumerProperties::truststoreType, truststoreType)
fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
fun keystore(keystore: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
+ property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
fun keystorePassword(keystorePassword: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
+ property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
fun keystoreType(keystoreType: JsonNode) =
- property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
+ property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
- sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
+ sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
- property(KafkaStreamsSslAuthConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
+ property(KafkaStreamsSslAuthConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}
class KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder() {
+
fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
fun saslMechanism(saslMechanism: JsonNode) =
- property(KafkaStreamsScramSslAuthConsumerProperties::saslMechanism, saslMechanism)
+ property(KafkaStreamsScramSslAuthConsumerProperties::saslMechanism, saslMechanism)
fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
fun scramUsername(scramUsername: JsonNode) =
- property(KafkaStreamsScramSslAuthConsumerProperties::scramUsername, scramUsername)
+ property(KafkaStreamsScramSslAuthConsumerProperties::scramUsername, scramUsername)
fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
fun scramPassword(scramPassword: JsonNode) =
- property(KafkaStreamsScramSslAuthConsumerProperties::scramPassword, scramPassword)
+ property(KafkaStreamsScramSslAuthConsumerProperties::scramPassword, scramPassword)
}
}
MessageLibConstants.TYPE_KAFKA_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaSslAuthMessageProducerProperties::class.java
+ prefix, KafkaSslAuthMessageProducerProperties::class.java
)
}
MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaScramSslAuthMessageProducerProperties::class.java
+ prefix, KafkaScramSslAuthMessageProducerProperties::class.java
)
}
else -> {
/** Message Consumer */
MessageLibConstants.TYPE_KAFKA_BASIC_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaBasicAuthMessageConsumerProperties::class.java
+ prefix, KafkaBasicAuthMessageConsumerProperties::class.java
)
}
MessageLibConstants.TYPE_KAFKA_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaSslAuthMessageConsumerProperties::class.java
+ prefix, KafkaSslAuthMessageConsumerProperties::class.java
)
}
MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaScramSslAuthMessageConsumerProperties::class.java
+ prefix, KafkaScramSslAuthMessageConsumerProperties::class.java
)
}
/** Stream Consumer */
MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaStreamsBasicAuthConsumerProperties::class.java
+ prefix, KafkaStreamsBasicAuthConsumerProperties::class.java
)
}
MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaStreamsSslAuthConsumerProperties::class.java
+ prefix, KafkaStreamsSslAuthConsumerProperties::class.java
)
}
MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH -> {
bluePrintPropertiesService.propertyBeanType(
- prefix, KafkaStreamsScramSslAuthConsumerProperties::class.java
+ prefix, KafkaStreamsScramSslAuthConsumerProperties::class.java
)
}
else -> {
}
private fun blueprintMessageConsumerService(messageConsumerProperties: MessageConsumerProperties):
- BlueprintMessageConsumerService {
+ BlueprintMessageConsumerService {
- when (messageConsumerProperties.type) {
- /** Message Consumer */
- MessageLibConstants.TYPE_KAFKA_BASIC_AUTH -> {
- return KafkaMessageConsumerService(
+ when (messageConsumerProperties.type) {
+ /** Message Consumer */
+ MessageLibConstants.TYPE_KAFKA_BASIC_AUTH -> {
+ return KafkaMessageConsumerService(
messageConsumerProperties as KafkaBasicAuthMessageConsumerProperties
- )
- }
- MessageLibConstants.TYPE_KAFKA_SSL_AUTH -> {
- return KafkaMessageConsumerService(
+ )
+ }
+ MessageLibConstants.TYPE_KAFKA_SSL_AUTH -> {
+ return KafkaMessageConsumerService(
messageConsumerProperties as KafkaSslAuthMessageConsumerProperties
- )
- }
- MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH -> {
- return KafkaMessageConsumerService(
+ )
+ }
+ MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH -> {
+ return KafkaMessageConsumerService(
messageConsumerProperties as KafkaScramSslAuthMessageConsumerProperties
- )
- }
- /** Stream Consumer */
- MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH -> {
- return KafkaStreamsConsumerService(
+ )
+ }
+ /** Stream Consumer */
+ MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH -> {
+ return KafkaStreamsConsumerService(
messageConsumerProperties as KafkaStreamsBasicAuthConsumerProperties
- )
- }
- MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH -> {
- return KafkaStreamsConsumerService(
+ )
+ }
+ MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH -> {
+ return KafkaStreamsConsumerService(
messageConsumerProperties as KafkaStreamsSslAuthConsumerProperties
- )
- }
- MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH -> {
- return KafkaStreamsConsumerService(
+ )
+ }
+ MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH -> {
+ return KafkaStreamsConsumerService(
messageConsumerProperties as KafkaStreamsScramSslAuthConsumerProperties
- )
- }
- else -> {
- throw BluePrintProcessorException("couldn't get message client service for ${messageConsumerProperties.type}")
+ )
+ }
+ else -> {
+ throw BluePrintProcessorException("couldn't get message client service for ${messageConsumerProperties.type}")
+ }
}
}
- }
}
}
interface KafkaStreamConsumerFunction : ConsumerFunction {
+
suspend fun createTopology(
messageConsumerProperties: MessageConsumerProperties,
additionalConfig: Map<String, Any>?
sendMessageNB(key, message, headers)
}
- fun sendMessage(key: String = UUID.randomUUID().toString(), topic: String, message: Any, headers: MutableMap<String, String>? = null): Boolean = runBlocking {
- sendMessageNB(key, topic, message, headers)
- }
+ fun sendMessage(key: String = UUID.randomUUID().toString(), topic: String, message: Any, headers: MutableMap<String, String>? = null): Boolean =
+ runBlocking {
+ sendMessageNB(key, topic, message, headers)
+ }
suspend fun sendMessageNB(key: String = UUID.randomUUID().toString(), message: Any, headers: MutableMap<String, String>? = null): Boolean
- suspend fun sendMessageNB(key: String = UUID.randomUUID().toString(), topic: String, message: Any, headers: MutableMap<String, String>? = null): Boolean
+ suspend fun sendMessageNB(
+ key: String = UUID.randomUUID().toString(),
+ topic: String,
+ message: Any,
+ headers: MutableMap<String, String>? = null
+ ): Boolean
}
private val messageLoggerService = MessageLoggerService()
companion object {
+
const val MAX_ERR_MSG_LEN = 128
}
/** Truncation of error messages */
var truncErrMsg = executionServiceOutput.status.errorMessage
if (truncErrMsg != null && truncErrMsg.length > MAX_ERR_MSG_LEN) {
- truncErrMsg = "${truncErrMsg.substring(0,MAX_ERR_MSG_LEN)}" +
- " [...]. Check Blueprint Processor logs for more information."
+ truncErrMsg = "${truncErrMsg.substring(0, MAX_ERR_MSG_LEN)}" +
+ " [...]. Check Blueprint Processor logs for more information."
}
/** Truncation for Command Executor responses */
var truncPayload = executionServiceOutput.payload.deepCopy()
val headers = consumerRecord.headers().toMap()
val localhost = InetAddress.getLocalHost()
MDC.put(
- "InvokeTimestamp", ZonedDateTime
+ "InvokeTimestamp",
+ ZonedDateTime
.ofInstant(Instant.ofEpochMilli(consumerRecord.timestamp()), ZoneOffset.UTC)
.format(DateTimeFormatter.ISO_INSTANT)
)
assertNotNull(relationshipTypes, "failed to get relationship types")
assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match")
assertNotNull(
- relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO],
- "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}"
+ relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO],
+ "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}"
)
assertNotNull(
- relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER],
- "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER}"
+ relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER],
+ "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER}"
)
}
@RunWith(SpringRunner::class)
@DirtiesContext
@ContextConfiguration(
- classes = [BluePrintMessageLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintMessageLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.messageconsumer.sample.type=kafka-scram-ssl-auth",
- "blueprintsprocessor.messageconsumer.sample.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageconsumer.sample.groupId=sample-group",
- "blueprintsprocessor.messageconsumer.sample.topic=default-topic",
- "blueprintsprocessor.messageconsumer.sample.clientId=default-client-id",
- "blueprintsprocessor.messageconsumer.sample.pollMillSec=10",
- "blueprintsprocessor.messageconsumer.sample.pollRecords=1",
- "blueprintsprocessor.messageconsumer.sample.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageconsumer.sample.truststorePassword=secretpassword",
- "blueprintsprocessor.messageconsumer.sample.keystore=/path/to/keystore.jks",
- "blueprintsprocessor.messageconsumer.sample.keystorePassword=secretpassword",
- "blueprintsprocessor.messageconsumer.sample.scramUsername=sample-user",
- "blueprintsprocessor.messageconsumer.sample.scramPassword=secretpassword",
+ [
+ "blueprintsprocessor.messageconsumer.sample.type=kafka-scram-ssl-auth",
+ "blueprintsprocessor.messageconsumer.sample.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageconsumer.sample.groupId=sample-group",
+ "blueprintsprocessor.messageconsumer.sample.topic=default-topic",
+ "blueprintsprocessor.messageconsumer.sample.clientId=default-client-id",
+ "blueprintsprocessor.messageconsumer.sample.pollMillSec=10",
+ "blueprintsprocessor.messageconsumer.sample.pollRecords=1",
+ "blueprintsprocessor.messageconsumer.sample.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageconsumer.sample.truststorePassword=secretpassword",
+ "blueprintsprocessor.messageconsumer.sample.keystore=/path/to/keystore.jks",
+ "blueprintsprocessor.messageconsumer.sample.keystorePassword=secretpassword",
+ "blueprintsprocessor.messageconsumer.sample.scramUsername=sample-user",
+ "blueprintsprocessor.messageconsumer.sample.scramPassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
- "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageproducer.sample.topic=default-topic",
- "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
- "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.keystore=/path/to/keystore.jks",
- "blueprintsprocessor.messageproducer.sample.keystorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
- "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword"
- ]
+ "blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
+ "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageproducer.sample.topic=default-topic",
+ "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
+ "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.sample.keystore=/path/to/keystore.jks",
+ "blueprintsprocessor.messageproducer.sample.keystorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
+ "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword"
+ ]
)
open class BlueprintMessageConsumerServiceTest {
fun testKafkaScramSslAuthConfig() {
val expectedConfig = mapOf<String, Any>(
- ProducerConfig.BOOTSTRAP_SERVERS_CONFIG to "127.0.0.1:9092",
- ConsumerConfig.GROUP_ID_CONFIG to "sample-group",
- ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG to true,
- ConsumerConfig.AUTO_OFFSET_RESET_CONFIG to "latest",
- ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG to StringDeserializer::class.java,
- ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG to ByteArrayDeserializer::class.java,
- ConsumerConfig.CLIENT_ID_CONFIG to "default-client-id",
- CommonClientConfigs.SECURITY_PROTOCOL_CONFIG to SecurityProtocol.SASL_SSL.toString(),
- SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG to "JKS",
- SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG to "/path/to/truststore.jks",
- SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG to "secretpassword",
- SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG to "/path/to/keystore.jks",
- SslConfigs.SSL_KEYSTORE_TYPE_CONFIG to "JKS",
- SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG to "secretpassword",
- SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG to SslConfigs.DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM,
- SaslConfigs.SASL_MECHANISM to "SCRAM-SHA-512",
- SaslConfigs.SASL_JAAS_CONFIG to "${ScramLoginModule::class.java.canonicalName} required " +
- "username=\"sample-user\" " +
- "password=\"secretpassword\";"
- )
+ ProducerConfig.BOOTSTRAP_SERVERS_CONFIG to "127.0.0.1:9092",
+ ConsumerConfig.GROUP_ID_CONFIG to "sample-group",
+ ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG to true,
+ ConsumerConfig.AUTO_OFFSET_RESET_CONFIG to "latest",
+ ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG to StringDeserializer::class.java,
+ ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG to ByteArrayDeserializer::class.java,
+ ConsumerConfig.CLIENT_ID_CONFIG to "default-client-id",
+ CommonClientConfigs.SECURITY_PROTOCOL_CONFIG to SecurityProtocol.SASL_SSL.toString(),
+ SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG to "JKS",
+ SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG to "/path/to/truststore.jks",
+ SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG to "secretpassword",
+ SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG to "/path/to/keystore.jks",
+ SslConfigs.SSL_KEYSTORE_TYPE_CONFIG to "JKS",
+ SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG to "secretpassword",
+ SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG to SslConfigs.DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM,
+ SaslConfigs.SASL_MECHANISM to "SCRAM-SHA-512",
+ SaslConfigs.SASL_JAAS_CONFIG to "${ScramLoginModule::class.java.canonicalName} required " +
+ "username=\"sample-user\" " +
+ "password=\"secretpassword\";"
+ )
val messageConsumerProperties = bluePrintMessageLibPropertyService
- .messageConsumerProperties("${MessageLibConstants.PROPERTY_MESSAGE_CONSUMER_PREFIX}sample")
+ .messageConsumerProperties("${MessageLibConstants.PROPERTY_MESSAGE_CONSUMER_PREFIX}sample")
val configProps = messageConsumerProperties.getConfig()
- assertEquals(messageConsumerProperties.topic,
- "default-topic",
- "Topic doesn't match the expected value"
+ assertEquals(
+ messageConsumerProperties.topic,
+ "default-topic",
+ "Topic doesn't match the expected value"
+ )
+ assertEquals(
+ messageConsumerProperties.type,
+ "kafka-scram-ssl-auth",
+ "Authentication type doesn't match the expected value"
)
- assertEquals(messageConsumerProperties.type,
- "kafka-scram-ssl-auth",
- "Authentication type doesn't match the expected value")
expectedConfig.forEach {
- assertTrue(configProps.containsKey(it.key),
- "Missing expected kafka config key : ${it.key}")
- assertEquals(configProps[it.key],
- it.value,
- "Unexpected value for ${it.key} got ${configProps[it.key]} instead of ${it.value}"
+ assertTrue(
+ configProps.containsKey(it.key),
+ "Missing expected kafka config key : ${it.key}"
+ )
+ assertEquals(
+ configProps[it.key],
+ it.value,
+ "Unexpected value for ${it.key} got ${configProps[it.key]} instead of ${it.value}"
)
}
}
@RunWith(SpringRunner::class)
@DirtiesContext
@ContextConfiguration(
- classes = [BluePrintMessageLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintMessageLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
- "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageproducer.sample.topic=default-topic",
- "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
- "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.keystore=/path/to/keystore.jks",
- "blueprintsprocessor.messageproducer.sample.keystorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
- "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword"
- ]
+ [
+ "blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
+ "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageproducer.sample.topic=default-topic",
+ "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
+ "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.sample.keystore=/path/to/keystore.jks",
+ "blueprintsprocessor.messageproducer.sample.keystorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
+ "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword"
+ ]
)
open class BlueprintMessageProducerServiceTest {
@Test
fun testKafkaScramSslAuthConfig() {
val expectedConfig = mapOf<String, Any>(
- ProducerConfig.BOOTSTRAP_SERVERS_CONFIG to "127.0.0.1:9092",
- ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG to StringSerializer::class.java,
- ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG to ByteArraySerializer::class.java,
- ProducerConfig.ACKS_CONFIG to "all",
- ProducerConfig.MAX_BLOCK_MS_CONFIG to 250,
- ProducerConfig.RECONNECT_BACKOFF_MS_CONFIG to 60 * 60 * 1000,
- ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG to true,
- ConsumerConfig.CLIENT_ID_CONFIG to "default-client-id",
- CommonClientConfigs.SECURITY_PROTOCOL_CONFIG to SecurityProtocol.SASL_SSL.toString(),
- SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG to "JKS",
- SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG to "/path/to/truststore.jks",
- SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG to "secretpassword",
- SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG to "/path/to/keystore.jks",
- SslConfigs.SSL_KEYSTORE_TYPE_CONFIG to "JKS",
- SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG to "secretpassword",
- SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG to SslConfigs.DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM,
- SaslConfigs.SASL_MECHANISM to "SCRAM-SHA-512",
- SaslConfigs.SASL_JAAS_CONFIG to "${ScramLoginModule::class.java.canonicalName} required " +
- "username=\"sample-user\" " +
- "password=\"secretpassword\";"
+ ProducerConfig.BOOTSTRAP_SERVERS_CONFIG to "127.0.0.1:9092",
+ ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG to StringSerializer::class.java,
+ ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG to ByteArraySerializer::class.java,
+ ProducerConfig.ACKS_CONFIG to "all",
+ ProducerConfig.MAX_BLOCK_MS_CONFIG to 250,
+ ProducerConfig.RECONNECT_BACKOFF_MS_CONFIG to 60 * 60 * 1000,
+ ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG to true,
+ ConsumerConfig.CLIENT_ID_CONFIG to "default-client-id",
+ CommonClientConfigs.SECURITY_PROTOCOL_CONFIG to SecurityProtocol.SASL_SSL.toString(),
+ SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG to "JKS",
+ SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG to "/path/to/truststore.jks",
+ SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG to "secretpassword",
+ SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG to "/path/to/keystore.jks",
+ SslConfigs.SSL_KEYSTORE_TYPE_CONFIG to "JKS",
+ SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG to "secretpassword",
+ SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG to SslConfigs.DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM,
+ SaslConfigs.SASL_MECHANISM to "SCRAM-SHA-512",
+ SaslConfigs.SASL_JAAS_CONFIG to "${ScramLoginModule::class.java.canonicalName} required " +
+ "username=\"sample-user\" " +
+ "password=\"secretpassword\";"
)
val messageProducerProperties = bluePrintMessageLibPropertyService
- .messageProducerProperties("${MessageLibConstants.PROPERTY_MESSAGE_PRODUCER_PREFIX}sample")
+ .messageProducerProperties("${MessageLibConstants.PROPERTY_MESSAGE_PRODUCER_PREFIX}sample")
val configProps = messageProducerProperties.getConfig()
- assertEquals(messageProducerProperties.topic,
- "default-topic",
- "Topic doesn't match the expected value"
+ assertEquals(
+ messageProducerProperties.topic,
+ "default-topic",
+ "Topic doesn't match the expected value"
+ )
+ assertEquals(
+ messageProducerProperties.type,
+ "kafka-scram-ssl-auth",
+ "Authentication type doesn't match the expected value"
)
- assertEquals(messageProducerProperties.type,
- "kafka-scram-ssl-auth",
- "Authentication type doesn't match the expected value")
expectedConfig.forEach {
- assertTrue(configProps.containsKey(it.key),
- "Missing expected kafka config key : ${it.key}"
+ assertTrue(
+ configProps.containsKey(it.key),
+ "Missing expected kafka config key : ${it.key}"
)
- assertEquals(configProps[it.key],
- it.value,
- "Unexpected value for ${it.key} got ${configProps[it.key]} instead of ${it.value}"
+ assertEquals(
+ configProps[it.key],
+ it.value,
+ "Unexpected value for ${it.key} got ${configProps[it.key]} instead of ${it.value}"
)
}
}
@RunWith(SpringRunner::class)
@DirtiesContext
@ContextConfiguration(
- classes = [BluePrintMessageLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintMessageLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- [
- "blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
- "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageproducer.sample.topic=default-stream-topic",
- "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
- "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
- "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword",
+ [
+ "blueprintsprocessor.messageproducer.sample.type=kafka-scram-ssl-auth",
+ "blueprintsprocessor.messageproducer.sample.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageproducer.sample.topic=default-stream-topic",
+ "blueprintsprocessor.messageproducer.sample.clientId=default-client-id",
+ "blueprintsprocessor.messageproducer.sample.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageproducer.sample.truststorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.sample.scramUsername=sample-user",
+ "blueprintsprocessor.messageproducer.sample.scramPassword=secretpassword",
- "blueprintsprocessor.messageconsumer.stream-consumer.type=kafka-streams-scram-ssl-auth",
- "blueprintsprocessor.messageconsumer.stream-consumer.bootstrapServers=127.0.0.1:9092",
- "blueprintsprocessor.messageconsumer.stream-consumer.applicationId=test-streams-application",
- "blueprintsprocessor.messageconsumer.stream-consumer.topic=default-stream-topic",
- "blueprintsprocessor.messageproducer.stream-consumer.truststore=/path/to/truststore.jks",
- "blueprintsprocessor.messageproducer.stream-consumer.truststorePassword=secretpassword",
- "blueprintsprocessor.messageproducer.stream-consumer.scramUsername=sample-user",
- "blueprintsprocessor.messageproducer.stream-consumer.scramPassword=secretpassword"
+ "blueprintsprocessor.messageconsumer.stream-consumer.type=kafka-streams-scram-ssl-auth",
+ "blueprintsprocessor.messageconsumer.stream-consumer.bootstrapServers=127.0.0.1:9092",
+ "blueprintsprocessor.messageconsumer.stream-consumer.applicationId=test-streams-application",
+ "blueprintsprocessor.messageconsumer.stream-consumer.topic=default-stream-topic",
+ "blueprintsprocessor.messageproducer.stream-consumer.truststore=/path/to/truststore.jks",
+ "blueprintsprocessor.messageproducer.stream-consumer.truststorePassword=secretpassword",
+ "blueprintsprocessor.messageproducer.stream-consumer.scramUsername=sample-user",
+ "blueprintsprocessor.messageproducer.stream-consumer.scramPassword=secretpassword"
- ]
+ ]
)
class KafkaStreamsConsumerServiceTest {
): Topology {
val topology = Topology()
val kafkaStreamsBasicAuthConsumerProperties = messageConsumerProperties
- as KafkaStreamsBasicAuthConsumerProperties
+ as KafkaStreamsBasicAuthConsumerProperties
val topics = kafkaStreamsBasicAuthConsumerProperties.topic.split(",")
topology.addSource("Source", *topics.toTypedArray())
import java.util.UUID
class PriorityMessage : Serializable {
+
lateinit var id: String
lateinit var requestMessage: String
}
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>nats-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor NATS Lib</name>
- <description>Blueprints Processor NATS Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - NATS Lib</name>
<dependencies>
<dependency>
<groupId>io.nats</groupId>
<artifactId>java-nats-streaming</artifactId>
</dependency>
-
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
</dependencies>
class NatsLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_NATS_LIB_PROPERTY = "blueprint-nats-lib-property-service"
const val DEFULT_NATS_SELECTOR = "cds-controller"
const val PROPERTY_NATS_PREFIX = "blueprintsprocessor.nats."
import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils
open class NatsConnectionProperties {
+
lateinit var type: String
var clusterId: String = NatsClusterUtils.clusterId()
var clientId: String = ClusterUtils.clusterNodeId()
lateinit var host: String
+
/** Rest endpoint selector to access Monitoring API */
var monitoringSelector: String? = null
}
open class TokenAuthNatsConnectionProperties : NatsConnectionProperties() {
+
lateinit var token: String
}
open class TLSAuthNatsConnectionProperties : NatsConnectionProperties() {
+
var trustCertCollection: String? = null
+
/** Below Used only for Mutual TLS */
var clientCertChain: String? = null
var clientPrivateKey: String? = null
}
class NatsTokenAuthPropertiesAssignmentBuilder : NatsConnectionPropertiesAssignmentBuilder() {
+
fun token(selector: String) = token(selector.asJsonPrimitive())
fun token(selector: JsonNode) = property(TokenAuthNatsConnectionProperties::token, selector)
fun bluePrintNatsService(natsConnectionProperties: NatsConnectionProperties):
BluePrintNatsService {
- return when (natsConnectionProperties) {
- is TokenAuthNatsConnectionProperties -> {
- TokenAuthNatsService(natsConnectionProperties)
- }
- is TLSAuthNatsConnectionProperties -> {
- TLSAuthNatsService(natsConnectionProperties)
- }
- else -> {
- throw BluePrintProcessorException("couldn't get NATS service for properties $natsConnectionProperties")
+ return when (natsConnectionProperties) {
+ is TokenAuthNatsConnectionProperties -> {
+ TokenAuthNatsService(natsConnectionProperties)
+ }
+ is TLSAuthNatsConnectionProperties -> {
+ TLSAuthNatsService(natsConnectionProperties)
+ }
+ else -> {
+ throw BluePrintProcessorException("couldn't get NATS service for properties $natsConnectionProperties")
+ }
}
}
- }
}
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintNatsLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintNatsLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.nats.cds-controller.type=token-auth",
- "blueprintsprocessor.nats.cds-controller.host=nats://localhost:4222",
- "blueprintsprocessor.nats.cds-controller.token=tokenAuth"
- ]
+ [
+ "blueprintsprocessor.nats.cds-controller.type=token-auth",
+ "blueprintsprocessor.nats.cds-controller.host=nats://localhost:4222",
+ "blueprintsprocessor.nats.cds-controller.token=tokenAuth"
+ ]
)
class BluePrintNatsLibPropertyServiceTest {
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>modules</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-modules</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <artifactId>commons</artifactId>
+ <artifactId>modules-commons</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Commons POM</name>
- <description>Blueprints Processor Commons</description>
+ <name>MS Blueprints Processor Modules - Commons</name>
<modules>
<module>processor-core</module>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>resource-dict</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>resource-dict</artifactId>
</dependency>
<!-- Test Dependencies -->
<dependency>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Core</name>
- <description>Blueprints Processor Core</description>
+ <name>MS Blueprints Processor Modules - Commons - Processor Core</name>
<dependencies>
- <dependency>
+ <dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
- </dependency>
+ </dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-proto</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
open class BluePrintCoreConfiguration(private val bluePrintPropertiesService: BluePrintPropertiesService) {
companion object {
+
const val PREFIX_BLUEPRINT_PROCESSOR = "blueprintsprocessor"
}
@Service
open class BluePrintPropertiesService(private var bluePrintPropertyConfig: BluePrintPropertyConfiguration) {
+
private val log = logger(BluePrintPropertiesService::class)
fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
*/
open class ExecutionServiceInput {
+
@get:ApiModelProperty(required = false, hidden = true)
var correlationUUID: String = UUID.randomUUID().toString()
+
@get:ApiModelProperty(required = true, value = "Headers providing request context.")
lateinit var commonHeader: CommonHeader
+
@get:ApiModelProperty(required = true, value = "Provide information about the action to execute.")
lateinit var actionIdentifiers: ActionIdentifiers
+
@get:ApiModelProperty(
required = true,
value = "Contain the information to be passed as input to the action." +
- "The payload is constituted of two section: the workflow input which is the higher level block (xxx-request)" +
- " and the input for resource resolution located within the xxx-request block, contained within xxx-properties"
+ "The payload is constituted of two section: the workflow input which is the higher level block (xxx-request)" +
+ " and the input for resource resolution located within the xxx-request block, contained within xxx-properties"
)
lateinit var payload: ObjectNode
+
@get:ApiModelProperty(hidden = true)
@get:JsonIgnore
var stepData: StepData? = null
}
open class ExecutionServiceOutput {
+
@get:ApiModelProperty(required = false, hidden = true)
var correlationUUID: String? = null
+
@get:ApiModelProperty(required = true, value = "Headers providing request context.")
lateinit var commonHeader: CommonHeader
+
@get:ApiModelProperty(required = true, value = "Provide information about the action to execute.")
lateinit var actionIdentifiers: ActionIdentifiers
+
@get:ApiModelProperty(required = true, value = "Status of the request.")
lateinit var status: Status
+
@get:ApiModelProperty(
required = true,
value = "Contain the information to be passed as input to the action." +
- "The payload is constituted of two section: the workflow input which is the higher level block (xxx-request)" +
- " and the input for resource resolution located within the xxx-request block, contained within xxx-properties"
+ "The payload is constituted of two section: the workflow input which is the higher level block (xxx-request)" +
+ " and the input for resource resolution located within the xxx-request block, contained within xxx-properties"
)
lateinit var payload: ObjectNode
+
@get:ApiModelProperty(hidden = true)
@get:JsonIgnore
var stepData: StepData? = null
const val ACTION_MODE_SYNC = "sync"
open class ActionIdentifiers {
+
@get:ApiModelProperty(required = false, value = "Name of the CBA.")
lateinit var blueprintName: String
+
@get:ApiModelProperty(required = false, value = "Version of the CBA.")
lateinit var blueprintVersion: String
+
@get:ApiModelProperty(required = true, value = "Name of the workflow to execute.")
lateinit var actionName: String
+
@get:ApiModelProperty(
required = true,
value = "Async processing is only supported for gRPC client.",
}
open class CommonHeader {
+
@get:ApiModelProperty(required = true, value = "Date of the execution", example = "2012-04-23T18:25:43.511Z")
@get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
var timestamp: Date = Date()
+
@get:ApiModelProperty(required = true, value = "Identify the system/person triggering the request.")
lateinit var originatorId: String
+
@get:ApiModelProperty(required = true, value = "Uniquely identify a request.")
lateinit var requestId: String
+
@get:ApiModelProperty(required = true, value = "Allow for fine-grain request identifier")
lateinit var subRequestId: String
+
@get:ApiModelProperty(required = false, hidden = true)
var flags: Flags? = null
}
open class Flags {
+
@get:ApiModelProperty(value = "Whether or not to force the action.")
var isForce: Boolean = false
+
@get:ApiModelProperty(value = "3600")
var ttl: Int = 3600
}
open class Status {
+
@get:ApiModelProperty(required = true, value = "HTTP status code equivalent.")
var code: Int = 200
+
@get:ApiModelProperty(required = true, value = "Type of the event being emitted by CDS.")
var eventType: String = EventType.EVENT_COMPONENT_EXECUTED.name
+
@get:ApiModelProperty(
required = true,
value = "Time when the execution ended.",
)
@get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
var timestamp: Date = Date()
+
@get:ApiModelProperty(required = false, value = "Error message when system failed")
var errorMessage: String? = null
+
@get:ApiModelProperty(required = true, value = "Message providing request status")
var message: String = BluePrintConstants.STATUS_SUCCESS
}
open class StepData {
+
lateinit var name: String
var properties: MutableMap<String, JsonNode> = mutableMapOf()
}
)
val configFile = configuration.configFile
+
/** Check file exists */
val clusterConfigFile = normalizedFile(configuration.configFile)
check(clusterConfigFile.absolutePath.endsWith("yaml", true)) {
open class BlueprintsClusterMembershipListener() :
MembershipListener {
+
private val log = logger(BlueprintsClusterMembershipListener::class)
override fun memberRemoved(membershipEvent: MembershipEvent) {
}
open class ClusterLockImpl(private val hazelcast: HazelcastInstance, private val name: String) : ClusterLock {
+
private val log = logger(ClusterLockImpl::class)
private val distributedLock: FencedLock = hazelcast.cpSubsystem.getLock(name)
override suspend fun tryLock(timeout: Long): Boolean {
return distributedLock.tryLock(timeout, TimeUnit.MILLISECONDS)
- .also { if (it) log.trace("Cluster lock acquired: $name")
- else log.trace("Failed to acquire Cluster lock $name within timeout $timeout") }
+ .also {
+ if (it) log.trace("Cluster lock acquired: $name")
+ else log.trace("Failed to acquire Cluster lock $name within timeout $timeout")
+ }
}
override suspend fun unLock() {
)
interface ClusterLock {
+
fun name(): String
suspend fun lock()
suspend fun fenceLock(): String
import org.junit.Test
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
-import java.lang.RuntimeException
import kotlin.test.assertEquals
class BluePrintClusterExtensionsTest {
try {
clusterLockMock.executeWithLock(1_000) { throw RuntimeException("It crashed") }
- } catch (e: Exception) { }
+ } catch (e: Exception) {
+ }
verify { runBlocking { clusterLockMock.unLock() } }
}
import kotlin.test.assertTrue
class HazelcastClusterServiceTest {
+
private val log = logger(HazelcastClusterServiceTest::class)
private val clusterSize = 3
}
open class SampleSchedulerTask : Runnable, Serializable {
+
private val log = logger(SampleSchedulerTask::class)
override fun run() {
log.info("I am scheduler action")
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>rest-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Rest Lib</name>
- <description>Blueprints Processor Rest Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - Rest Lib</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
class RestLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_REST_LIB_PROPERTY = "blueprint-rest-lib-property-service"
const val PROPERTY_REST_CLIENT_PREFIX = "blueprintsprocessor.restclient."
const val PROPERTY_TYPE = "type"
package org.onap.ccsdk.cds.blueprintsprocessor.rest
open class RestClientProperties {
+
lateinit var type: String
lateinit var url: String
var additionalHeaders: Map<String, String>? = null
}
open class SSLRestClientProperties : RestClientProperties() {
+
lateinit var keyStoreInstance: String // JKS, PKCS12
lateinit var sslTrust: String
lateinit var sslTrustPassword: String
}
open class BasicAuthRestClientProperties : RestClientProperties() {
+
lateinit var password: String
lateinit var username: String
}
open class TokenAuthRestClientProperties : RestClientProperties() {
+
var token: String? = null
}
open class PolicyManagerRestClientProperties : RestClientProperties() {
+
lateinit var env: String
lateinit var clientAuth: String
lateinit var authorisation: String
}
open class BasicAuthRestClientPropertiesAssignmentBuilder : RestClientPropertiesAssignmentBuilder() {
+
open fun password(password: String) {
password(password.asJsonPrimitive())
}
}
open class TokenAuthRestClientPropertiesAssignmentBuilder : RestClientPropertiesAssignmentBuilder() {
+
open fun token(token: String) {
token(token.asJsonPrimitive())
}
}
open class SslAuthRestClientPropertiesAssignmentBuilder : RestClientPropertiesAssignmentBuilder() {
+
open fun keyStoreInstance(keyStoreInstance: String) {
keyStoreInstance(keyStoreInstance.asJsonPrimitive())
}
import reactor.util.context.Context
open class RestServerLoggingWebFilter : WebFilter {
+
override fun filter(serverWebExchange: ServerWebExchange, webFilterChain: WebFilterChain): Mono<Void> {
val loggingService = RestLoggerService()
class BasicAuthRestClientService(
private val restClientProperties:
- BasicAuthRestClientProperties
+ BasicAuthRestClientProperties
) :
BlueprintWebClientService {
}
override fun convertToBasicHeaders(headers: Map<String, String>):
- Array<BasicHeader> {
- val customHeaders: MutableMap<String, String> = headers.toMutableMap()
- // inject additionalHeaders
- customHeaders.putAll(verifyAdditionalHeaders(restClientProperties))
+ Array<BasicHeader> {
+ val customHeaders: MutableMap<String, String> = headers.toMutableMap()
+ // inject additionalHeaders
+ customHeaders.putAll(verifyAdditionalHeaders(restClientProperties))
- if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) {
- val encodedCredentials = setBasicAuth(
- restClientProperties.username,
- restClientProperties.password
- )
- customHeaders[HttpHeaders.AUTHORIZATION] =
- "Basic $encodedCredentials"
+ if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) {
+ val encodedCredentials = setBasicAuth(
+ restClientProperties.username,
+ restClientProperties.password
+ )
+ customHeaders[HttpHeaders.AUTHORIZATION] =
+ "Basic $encodedCredentials"
+ }
+ return super.convertToBasicHeaders(customHeaders)
}
- return super.convertToBasicHeaders(customHeaders)
- }
private fun setBasicAuth(username: String, password: String): String {
val credentialsString = "$username:$password"
else -> {
throw BluePrintProcessorException(
"Rest adaptor($type) is" +
- " not supported"
+ " not supported"
)
}
}
}
private fun blueprintWebClientService(restClientProperties: RestClientProperties):
- BlueprintWebClientService {
-
- when (restClientProperties) {
- is SSLRestClientProperties -> {
- return SSLRestClientService(restClientProperties)
- }
- is TokenAuthRestClientProperties -> {
- return TokenAuthRestClientService(restClientProperties)
- }
- is BasicAuthRestClientProperties -> {
- return BasicAuthRestClientService(restClientProperties)
- }
- else -> {
- throw BluePrintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}")
+ BlueprintWebClientService {
+
+ when (restClientProperties) {
+ is SSLRestClientProperties -> {
+ return SSLRestClientService(restClientProperties)
+ }
+ is TokenAuthRestClientProperties -> {
+ return TokenAuthRestClientService(restClientProperties)
+ }
+ is BasicAuthRestClientProperties -> {
+ return BasicAuthRestClientService(restClientProperties)
+ }
+ else -> {
+ throw BluePrintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}")
+ }
}
}
- }
private fun tokenRestClientProperties(prefix: String):
- TokenAuthRestClientProperties {
- return bluePrintPropertiesService.propertyBeanType(
- prefix, TokenAuthRestClientProperties::class.java
- )
- }
+ TokenAuthRestClientProperties {
+ return bluePrintPropertiesService.propertyBeanType(
+ prefix, TokenAuthRestClientProperties::class.java
+ )
+ }
private fun basicAuthRestClientProperties(prefix: String):
- BasicAuthRestClientProperties {
- return bluePrintPropertiesService.propertyBeanType(
- prefix, BasicAuthRestClientProperties::class.java
- )
- }
+ BasicAuthRestClientProperties {
+ return bluePrintPropertiesService.propertyBeanType(
+ prefix, BasicAuthRestClientProperties::class.java
+ )
+ }
private fun sslBasicAuthRestClientProperties(prefix: String):
- SSLRestClientProperties {
+ SSLRestClientProperties {
- val sslProps: SSLBasicAuthRestClientProperties =
- bluePrintPropertiesService.propertyBeanType(
- prefix, SSLBasicAuthRestClientProperties::class.java
- )
- val basicProps: BasicAuthRestClientProperties =
- bluePrintPropertiesService.propertyBeanType(
- prefix, BasicAuthRestClientProperties::class.java
- )
- sslProps.basicAuth = basicProps
- return sslProps
- }
+ val sslProps: SSLBasicAuthRestClientProperties =
+ bluePrintPropertiesService.propertyBeanType(
+ prefix, SSLBasicAuthRestClientProperties::class.java
+ )
+ val basicProps: BasicAuthRestClientProperties =
+ bluePrintPropertiesService.propertyBeanType(
+ prefix, BasicAuthRestClientProperties::class.java
+ )
+ sslProps.basicAuth = basicProps
+ return sslProps
+ }
private fun sslTokenAuthRestClientProperties(prefix: String):
- SSLRestClientProperties {
+ SSLRestClientProperties {
- val sslProps: SSLTokenAuthRestClientProperties =
- bluePrintPropertiesService.propertyBeanType(
- prefix,
- SSLTokenAuthRestClientProperties::class.java
- )
- val basicProps: TokenAuthRestClientProperties =
- bluePrintPropertiesService.propertyBeanType(
- prefix,
- TokenAuthRestClientProperties::class.java
- )
- sslProps.tokenAuth = basicProps
- return sslProps
- }
+ val sslProps: SSLTokenAuthRestClientProperties =
+ bluePrintPropertiesService.propertyBeanType(
+ prefix,
+ SSLTokenAuthRestClientProperties::class.java
+ )
+ val basicProps: TokenAuthRestClientProperties =
+ bluePrintPropertiesService.propertyBeanType(
+ prefix,
+ TokenAuthRestClientProperties::class.java
+ )
+ sslProps.tokenAuth = basicProps
+ return sslProps
+ }
private fun sslNoAuthRestClientProperties(prefix: String):
- SSLRestClientProperties {
- return bluePrintPropertiesService.propertyBeanType(
- prefix, SSLRestClientProperties::class.java
- )
- }
+ SSLRestClientProperties {
+ return bluePrintPropertiesService.propertyBeanType(
+ prefix, SSLRestClientProperties::class.java
+ )
+ }
private fun policyManagerRestClientProperties(prefix: String):
- PolicyManagerRestClientProperties {
- return bluePrintPropertiesService.propertyBeanType(
- prefix, PolicyManagerRestClientProperties::class.java
- )
- }
+ PolicyManagerRestClientProperties {
+ return bluePrintPropertiesService.propertyBeanType(
+ prefix, PolicyManagerRestClientProperties::class.java
+ )
+ }
interface PreInterceptor {
+
fun getInstance(jsonNode: JsonNode): BlueprintWebClientService?
fun getInstance(selector: String): BlueprintWebClientService?
}
interface PostInterceptor {
+
fun getInstance(jsonNode: JsonNode, service: BlueprintWebClientService): BlueprintWebClientService
fun getInstance(selector: String, service: BlueprintWebClientService): BlueprintWebClientService
httpUriRequest: HttpUriRequest,
responseType: Class<T>
):
- WebClientResponse<T> {
- val httpResponse = httpClient().execute(httpUriRequest)
- val statusCode = httpResponse.statusLine.statusCode
- httpResponse.entity.content.use {
- val body = getResponse(it, responseType)
- return WebClientResponse(statusCode, body)
+ WebClientResponse<T> {
+ val httpResponse = httpClient().execute(httpUriRequest)
+ val statusCode = httpResponse.statusLine.statusCode
+ httpResponse.entity.content.use {
+ val body = getResponse(it, responseType)
+ return WebClientResponse(statusCode, body)
+ }
}
- }
suspend fun getNB(path: String): WebClientResponse<String> {
return getNB(path, null, String::class.java)
}
suspend fun <T> getNB(path: String, additionalHeaders: Array<BasicHeader>?, responseType: Class<T>):
- WebClientResponse<T> = withContext(Dispatchers.IO) {
- get(path, additionalHeaders!!, responseType)
- }
+ WebClientResponse<T> = withContext(Dispatchers.IO) {
+ get(path, additionalHeaders!!, responseType)
+ }
suspend fun postNB(path: String, request: Any): WebClientResponse<String> {
return postNB(path, request, null, String::class.java)
}
suspend fun <T> deleteNB(path: String, additionalHeaders: Array<BasicHeader>?):
- WebClientResponse<String> {
- return deleteNB(path, additionalHeaders, String::class.java)
- }
+ WebClientResponse<String> {
+ return deleteNB(path, additionalHeaders, String::class.java)
+ }
suspend fun <T> deleteNB(path: String, additionalHeaders: Array<BasicHeader>?, responseType: Class<T>):
- WebClientResponse<T> = withContext(Dispatchers.IO) {
- delete(path, additionalHeaders!!, responseType)
- }
+ WebClientResponse<T> = withContext(Dispatchers.IO) {
+ delete(path, additionalHeaders!!, responseType)
+ }
suspend fun <T> patchNB(path: String, request: Any, additionalHeaders: Array<BasicHeader>?, responseType: Class<T>):
- WebClientResponse<T> = withContext(Dispatchers.IO) {
- patch(path, request, additionalHeaders!!, responseType)
- }
+ WebClientResponse<T> = withContext(Dispatchers.IO) {
+ patch(path, request, additionalHeaders!!, responseType)
+ }
suspend fun exchangeNB(methodType: String, path: String, request: Any): WebClientResponse<String> {
return exchangeNB(
}
suspend fun exchangeNB(methodType: String, path: String, request: Any, additionalHeaders: Map<String, String>?):
- WebClientResponse<String> {
- return exchangeNB(methodType, path, request, additionalHeaders, String::class.java)
- }
+ WebClientResponse<String> {
+ return exchangeNB(methodType, path, request, additionalHeaders, String::class.java)
+ }
suspend fun <T> exchangeNB(
methodType: String,
}
private fun basicHeaders(headers: Map<String, String>?):
- Array<BasicHeader> {
- val basicHeaders = mutableListOf<BasicHeader>()
- defaultHeaders().forEach { (name, value) ->
- basicHeaders.add(BasicHeader(name, value))
- }
- headers?.forEach { name, value ->
- basicHeaders.add(BasicHeader(name, value))
+ Array<BasicHeader> {
+ val basicHeaders = mutableListOf<BasicHeader>()
+ defaultHeaders().forEach { (name, value) ->
+ basicHeaders.add(BasicHeader(name, value))
+ }
+ headers?.forEach { name, value ->
+ basicHeaders.add(BasicHeader(name, value))
+ }
+ return basicHeaders.toTypedArray()
}
- return basicHeaders.toTypedArray()
- }
// Non Blocking Rest Implementation
suspend fun httpClientNB(): CloseableHttpClient {
restClientProperties.additionalHeaders?.let {
if (it.keys.map { k -> k.toLowerCase().trim() }.contains(HttpHeaders.AUTHORIZATION.toLowerCase())) {
val errMsg = "Error in definition of endpoint ${restClientProperties.url}." +
- " User-supplied \"additionalHeaders\" cannot contain AUTHORIZATION header with" +
- " auth-type \"${RestLibConstants.TYPE_BASIC_AUTH}\""
+ " User-supplied \"additionalHeaders\" cannot contain AUTHORIZATION header with" +
+ " auth-type \"${RestLibConstants.TYPE_BASIC_AUTH}\""
WebClientUtils.log.error(errMsg)
throw BluePrintProcessorException(errMsg)
} else {
import kotlin.coroutines.EmptyCoroutineContext
class RestLoggerService {
+
private val log = logger(RestLoggerService::class)
companion object {
+
/** Used before invoking any REST outbound request, Inbound Invocation ID is used as request Id
* for outbound Request, If invocation Id is missing then default Request Id will be generated.
*/
block: suspend CoroutineScope.() -> T
) = coroutineScope {
val reactorContext = this.coroutineContext[ReactorContext]
+
/** Populate MDC context only if present in Reactor Context */
val newContext = if (reactorContext != null &&
!reactorContext.context.isEmpty &&
block: suspend CoroutineScope.() -> T?
): Mono<T> = Mono.create { sink ->
- val reactorContext = (context[ReactorContext]?.context?.putAll(sink.currentContext())
- ?: sink.currentContext()).asCoroutineContext()
+ val reactorContext = (
+ context[ReactorContext]?.context?.putAll(sink.currentContext())
+ ?: sink.currentContext()
+ ).asCoroutineContext()
+
/** Populate MDC context only if present in Reactor Context */
val newContext = if (!reactorContext.context.isEmpty &&
reactorContext.context.hasKey(MDCContext)
class TokenAuthRestClientService(
private val restClientProperties:
- TokenAuthRestClientProperties
+ TokenAuthRestClientProperties
) :
BlueprintWebClientService {
}
override fun convertToBasicHeaders(headers: Map<String, String>):
- Array<BasicHeader> {
- val customHeaders: MutableMap<String, String> = headers.toMutableMap()
- // inject additionalHeaders
- customHeaders.putAll(verifyAdditionalHeaders(restClientProperties))
- if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) {
- customHeaders[HttpHeaders.AUTHORIZATION] = restClientProperties.token!!
+ Array<BasicHeader> {
+ val customHeaders: MutableMap<String, String> = headers.toMutableMap()
+ // inject additionalHeaders
+ customHeaders.putAll(verifyAdditionalHeaders(restClientProperties))
+ if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) {
+ customHeaders[HttpHeaders.AUTHORIZATION] = restClientProperties.token!!
+ }
+ return super.convertToBasicHeaders(customHeaders)
}
- return super.convertToBasicHeaders(customHeaders)
- }
override fun host(uri: String): String {
return restClientProperties.url + uri
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintRestLibConfiguration::class, BluePrintPropertyConfiguration::class,
- BluePrintPropertiesService::class]
+ classes = [
+ BluePrintRestLibConfiguration::class, BluePrintPropertyConfiguration::class,
+ BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.restclient.sample.type=basic-auth",
- "blueprintsprocessor.restclient.sample.url=http://localhost:8080",
- "blueprintsprocessor.restclient.sample.userId=sampleuser",
- "blueprintsprocessor.restclient.sslbasic.type=ssl-basic-auth",
- "blueprintsprocessor.restclient.sslbasic.url=https://localhost:8443",
- "blueprintsprocessor.restclient.sslbasic.username=admin",
- "blueprintsprocessor.restclient.sslbasic.password=cds",
- "blueprintsprocessor.restclient.sslbasic.keyStoreInstance=PKCS12",
- "blueprintsprocessor.restclient.sslbasic.sslTrust=src/test/resources/keystore.p12",
- "blueprintsprocessor.restclient.sslbasic.sslTrustPassword=changeit",
- "blueprintsprocessor.restclient.ssltoken.type=ssl-token-auth",
- "blueprintsprocessor.restclient.ssltoken.url=https://localhost:8443",
- "blueprintsprocessor.restclient.ssltoken.token=72178473kjshdkjgvbsdkjv903274908",
- "blueprintsprocessor.restclient.ssltoken.keyStoreInstance=PKCS12",
- "blueprintsprocessor.restclient.ssltoken.sslTrust=src/test/resources/keystore.p12",
- "blueprintsprocessor.restclient.ssltoken.sslTrustPassword=changeit",
- "blueprintsprocessor.restclient.ssl.type=ssl-no-auth",
- "blueprintsprocessor.restclient.ssl.url=https://localhost:8443",
- "blueprintsprocessor.restclient.ssl.keyStoreInstance=PKCS12",
- "blueprintsprocessor.restclient.ssl.sslTrust=src/test/resources/keystore.p12",
- "blueprintsprocessor.restclient.ssl.sslTrustPassword=changeit",
- "blueprintsprocessor.restclient.ssl.sslKey=src/test/resources/keystore.p12",
- "blueprintsprocessor.restclient.ssl.sslKeyPassword=changeit"
- ]
+ [
+ "blueprintsprocessor.restclient.sample.type=basic-auth",
+ "blueprintsprocessor.restclient.sample.url=http://localhost:8080",
+ "blueprintsprocessor.restclient.sample.userId=sampleuser",
+ "blueprintsprocessor.restclient.sslbasic.type=ssl-basic-auth",
+ "blueprintsprocessor.restclient.sslbasic.url=https://localhost:8443",
+ "blueprintsprocessor.restclient.sslbasic.username=admin",
+ "blueprintsprocessor.restclient.sslbasic.password=cds",
+ "blueprintsprocessor.restclient.sslbasic.keyStoreInstance=PKCS12",
+ "blueprintsprocessor.restclient.sslbasic.sslTrust=src/test/resources/keystore.p12",
+ "blueprintsprocessor.restclient.sslbasic.sslTrustPassword=changeit",
+ "blueprintsprocessor.restclient.ssltoken.type=ssl-token-auth",
+ "blueprintsprocessor.restclient.ssltoken.url=https://localhost:8443",
+ "blueprintsprocessor.restclient.ssltoken.token=72178473kjshdkjgvbsdkjv903274908",
+ "blueprintsprocessor.restclient.ssltoken.keyStoreInstance=PKCS12",
+ "blueprintsprocessor.restclient.ssltoken.sslTrust=src/test/resources/keystore.p12",
+ "blueprintsprocessor.restclient.ssltoken.sslTrustPassword=changeit",
+ "blueprintsprocessor.restclient.ssl.type=ssl-no-auth",
+ "blueprintsprocessor.restclient.ssl.url=https://localhost:8443",
+ "blueprintsprocessor.restclient.ssl.keyStoreInstance=PKCS12",
+ "blueprintsprocessor.restclient.ssl.sslTrust=src/test/resources/keystore.p12",
+ "blueprintsprocessor.restclient.ssl.sslTrustPassword=changeit",
+ "blueprintsprocessor.restclient.ssl.sslKey=src/test/resources/keystore.p12",
+ "blueprintsprocessor.restclient.ssl.sslKeyPassword=changeit"
+ ]
)
class BluePrintRestLibPropertyServiceTest {
)
assertNotNull(properties, "failed to create property bean")
assertNotNull(
- properties.url, "failed to get url property in" +
- " property bean"
+ properties.url,
+ "failed to get url property in" +
+ " property bean"
)
}
}
companion object BluePrintRestLibPropertyServiceTest {
+
val defaultMapper = ObjectMapper()
val expectedTokenAuthDefaultHeaders = mapOf<String, String>(
"Content-Type" to "application/json",
""",
"additionalHeaders" : {
"authorization": "Basic aGF2ZTphbmljZWRheQo="
- }""".trimIndent()
+ }
+ """.trimIndent()
)
private fun sslTokenAuthEndpointWithHeadersField(headers: String = ""): String =
"username" : "admin",
"password" : "cds"
}$headers
- }""".trimIndent()
+ }
+ """.trimIndent()
private fun sslNoAuthEndpointWithHeadersField(headers: String = ""): String = """{
"type" : "ssl-no-auth",
"sslTrustPassword" : "changeit",
"sslKey" : "src/test/resources/keystore.p12",
"sslKeyPassword" : "changeit"$headers
- }""".trimIndent()
+ }
+ """.trimIndent()
// Don't forget to supply "," as the first char to make valid JSON
private fun basicAuthEndpointWithHeadersField(headers: String = ""): String =
"url": "http://127.0.0.1:8000",
"username": "user",
"password": "pass"$headers
- }""".trimIndent()
+ }
+ """.trimIndent()
private val emptyAdditionalHeaders = """,
"additionalHeaders" : {
- }""".trimIndent()
+ }
+ """.trimIndent()
private val oneAdditionalParameter = """,
"additionalHeaders" : {
"key1": "value1"
- }""".trimIndent()
+ }
+ """.trimIndent()
private val threeAdditionalHeaders = """,
"additionalHeaders" : {
"key1": "value1",
"key2": "value2",
"key3": "value3"
- }""".trimIndent()
+ }
+ """.trimIndent()
private val contentTypeAdditionalHeader = """,
"additionalHeaders" : {
"${HttpHeaders.CONTENT_TYPE}": "${MediaType.APPLICATION_XML}"
- }""".trimIndent()
+ }
+ """.trimIndent()
private val additionalHeadersWithAuth = """,
"additionalHeaders" : {
"Authorization": "Basic aGF2ZTphbmljZWRheQo="
- }""".trimIndent()
+ }
+ """.trimIndent()
private val additionalHeadersWithAuthLowercased = """,
"additionalHeaders" : {
"authorization": "Basic aGF2ZTphbmljZWRheQo="
- }""".trimIndent()
+ }
+ """.trimIndent()
}
}
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextConfiguration(
- classes = [BluePrintRestLibConfiguration::class, SampleController::class,
+ classes = [
+ BluePrintRestLibConfiguration::class, SampleController::class,
SecurityConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- [
- "server.port=8443",
- "server.ssl.enabled=true",
- "server.ssl.key-store=classpath:keystore.p12",
- "server.ssl.key-store-password=changeit",
- "server.ssl.keyStoreType=PKCS12",
- "server.ssl.keyAlias=tomcat",
- "blueprintsprocessor.restclient.sample.type=basic-auth",
- "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:9081",
- "blueprintsprocessor.restclient.sample.username=admin",
- "blueprintsprocessor.restclient.sample.password=jans",
- "blueprintsprocessor.restclient.test.type=ssl-basic-auth",
- "blueprintsprocessor.restclient.test.url=https://localhost:8443",
- "blueprintsprocessor.restclient.test.username=admin",
- "blueprintsprocessor.restclient.test.password=jans",
- "blueprintsprocessor.restclient.test.keyStoreInstance=PKCS12",
- "blueprintsprocessor.restclient.test.sslTrust=src/test/resources/keystore.p12",
- "blueprintsprocessor.restclient.test.sslTrustPassword=changeit"
- ]
+ [
+ "server.port=8443",
+ "server.ssl.enabled=true",
+ "server.ssl.key-store=classpath:keystore.p12",
+ "server.ssl.key-store-password=changeit",
+ "server.ssl.keyStoreType=PKCS12",
+ "server.ssl.keyAlias=tomcat",
+ "blueprintsprocessor.restclient.sample.type=basic-auth",
+ "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:9081",
+ "blueprintsprocessor.restclient.sample.username=admin",
+ "blueprintsprocessor.restclient.sample.password=jans",
+ "blueprintsprocessor.restclient.test.type=ssl-basic-auth",
+ "blueprintsprocessor.restclient.test.url=https://localhost:8443",
+ "blueprintsprocessor.restclient.test.username=admin",
+ "blueprintsprocessor.restclient.test.password=jans",
+ "blueprintsprocessor.restclient.test.keyStoreInstance=PKCS12",
+ "blueprintsprocessor.restclient.test.sslTrust=src/test/resources/keystore.p12",
+ "blueprintsprocessor.restclient.test.sslTrustPassword=changeit"
+ ]
)
class RestClientServiceTest {
@Test
fun testGetQueryParam() {
val restClientService = bluePrintRestLibPropertyService
- .blueprintWebClientService("sample")
+ .blueprintWebClientService("sample")
val response = restClientService.exchangeResource(
- HttpMethod.GET.name, "/sample/query?id=3", ""
+ HttpMethod.GET.name, "/sample/query?id=3", ""
)
assertEquals(
- "query with id:3", response.body,
- "failed to get query param response"
+ "query with id:3", response.body,
+ "failed to get query param response"
)
}
@Test
fun testGetPathParamWithWhitespace() {
val restClientService = bluePrintRestLibPropertyService
- .blueprintWebClientService("sample")
+ .blueprintWebClientService("sample")
val response = restClientService.exchangeResource(
- HttpMethod.GET.name, "/sample/path/id 3/get", ""
+ HttpMethod.GET.name, "/sample/path/id 3/get", ""
)
assertEquals(
- "path param id:id 3", response.body,
- "failed to get query param response"
+ "path param id:id 3", response.body,
+ "failed to get query param response"
)
}
@Test
fun testSimpleBasicAuth() {
val json: String = "{\n" +
- " \"type\" : \"basic-auth\",\n" +
- " \"url\" : \"http://localhost:9081\",\n" +
- " \"username\" : \"admin\",\n" +
- " \"password\" : \"jans\"\n" +
- "}"
+ " \"type\" : \"basic-auth\",\n" +
+ " \"url\" : \"http://localhost:9081\",\n" +
+ " \"username\" : \"admin\",\n" +
+ " \"password\" : \"jans\"\n" +
+ "}"
val mapper = ObjectMapper()
val actualObj: JsonNode = mapper.readTree(json)
val restClientService = bluePrintRestLibPropertyService
headers["X-TransactionId"] = "9999"
headers["X-FromAppId"] = "AAI"
val post1 = "{\n" +
- " \"customer\": {\n" +
- " \"global-customer-id\": \"ONSDEMOBJHKCustomer\",\n" +
- " \"subscriber-name\": \"ONSDEMOBJHKCustomer\",\n" +
- " \"subscriber-type\": \"CUST\",\n" +
- " \"resource-version\": \"1552985011163\"\n" +
- " }\n" +
- "}"
+ " \"customer\": {\n" +
+ " \"global-customer-id\": \"ONSDEMOBJHKCustomer\",\n" +
+ " \"subscriber-name\": \"ONSDEMOBJHKCustomer\",\n" +
+ " \"subscriber-type\": \"CUST\",\n" +
+ " \"resource-version\": \"1552985011163\"\n" +
+ " }\n" +
+ "}"
lateinit var res1: Customer
lateinit var res2: Customer
lateinit var res3: String
@GetMapping("/query")
fun getQuery(@RequestParam("id") id: String): String =
- "query with id:$id"
+ "query with id:$id"
@GetMapping("/path/{id}/get")
fun getPathParam(@PathVariable("id") id: String): String =
- "path param id:$id"
+ "path param id:$id"
@PatchMapping("/name")
fun patchName(): String = "Patch request successful"
return ""
}
return "{\n" +
- " \"id\": \"ONSDEMOBJHKCustomer\",\n" +
- " \"name\": \"ONSDEMOBJHKCustomer\",\n" +
- " \"type\": \"CUST\",\n" +
- " \"resource\": \"1552985011163\"\n" +
- "}"
+ " \"id\": \"ONSDEMOBJHKCustomer\",\n" +
+ " \"name\": \"ONSDEMOBJHKCustomer\",\n" +
+ " \"type\": \"CUST\",\n" +
+ " \"resource\": \"1552985011163\"\n" +
+ "}"
}
@PostMapping("/aai/v14/business/customers")
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-commons</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>ssh-lib</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor SSH Lib</name>
- <description>Blueprints Processor SSH Lib</description>
+ <name>MS Blueprints Processor Modules - Commons - SSH Lib</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
class SshLibConstants {
companion object {
+
const val SERVICE_BLUEPRINT_SSH_LIB_PROPERTY = "blueprint-ssh-lib-property-service"
const val PROPERTY_SSH_CLIENT_PREFIX = "blueprintsprocessor.sshclient."
const val TYPE_BASIC_AUTH = "basic-auth"
package org.onap.ccsdk.cds.blueprintsprocessor.ssh
open class SshClientProperties {
+
lateinit var type: String
lateinit var host: String
var port: Int = 22
}
open class BasicAuthSshClientProperties : SshClientProperties() {
+
lateinit var password: String
lateinit var username: String
}
import java.io.IOException
import java.io.PipedInputStream
import java.io.PipedOutputStream
+import java.util.ArrayList
import java.util.Collections
import java.util.EnumSet
import java.util.Scanner
-import java.util.ArrayList
open class BasicAuthSshClientService(private val basicAuthSshClientProperties: BasicAuthSshClientProperties) :
- BlueprintSshClientService {
+ BlueprintSshClientService {
private val log = LoggerFactory.getLogger(BasicAuthSshClientService::class.java)!!
private val newLine = "\n".toByteArray()
log.debug("SSH Client Service started successfully")
clientSession = sshClient.connect(
- basicAuthSshClientProperties.username, basicAuthSshClientProperties.host,
- basicAuthSshClientProperties.port).verify(basicAuthSshClientProperties.connectionTimeOut).session
+ basicAuthSshClientProperties.username, basicAuthSshClientProperties.host,
+ basicAuthSshClientProperties.port
+ ).verify(basicAuthSshClientProperties.connectionTimeOut).session
clientSession.addPasswordIdentity(basicAuthSshClientProperties.password)
clientSession.auth().verify(basicAuthSshClientProperties.connectionTimeOut)
}
}
- override suspend fun executeCommandsNB(commands: List <String>, timeOut: Long): List<CommandResult> {
+ override suspend fun executeCommandsNB(commands: List<String>, timeOut: Long): List<CommandResult> {
val response = ArrayList<CommandResult>()
try {
var stopLoop = false
private fun waitForPrompt(timeOut: Long): String {
val waitMask = channel!!.waitFor(
- Collections.unmodifiableSet(EnumSet.of(ClientChannelEvent.CLOSED)), timeOut)
+ Collections.unmodifiableSet(EnumSet.of(ClientChannelEvent.CLOSED)), timeOut
+ )
if (channel!!.out.toString().indexOfAny(arrayListOf("$", ">", "#")) <= 0 && waitMask.contains(ClientChannelEvent.TIMEOUT)) {
throw BluePrintProcessorException("Timeout: Failed to retrieve commands result in $timeOut ms")
}
Scanner(output).use { scanner ->
while (scanner.hasNextLine()) {
val temp = scanner.nextLine()
- if (temp.isNotBlank() && (temp.trim { it <= ' ' }.startsWith("%") ||
- temp.trim { it <= ' ' }.startsWith("syntax error"))) {
+ if (temp.isNotBlank() && (
+ temp.trim { it <= ' ' }.startsWith("%") ||
+ temp.trim { it <= ' ' }.startsWith("syntax error")
+ )
+ ) {
return true
}
}
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintSshLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintSshLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.sshclient.sample.type=basic-auth",
- "blueprintsprocessor.sshclient.sample.host=127.0.0.1",
- "blueprintsprocessor.sshclient.sample.port=22",
- "blueprintsprocessor.sshclient.sample.password=1234",
- "blueprintsprocessor.sshclient.sample.username=dummy"
- ]
+ [
+ "blueprintsprocessor.sshclient.sample.type=basic-auth",
+ "blueprintsprocessor.sshclient.sample.host=127.0.0.1",
+ "blueprintsprocessor.sshclient.sample.port=22",
+ "blueprintsprocessor.sshclient.sample.password=1234",
+ "blueprintsprocessor.sshclient.sample.username=dummy"
+ ]
)
class BluePrintSshLibPropertyServiceTest {
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
import org.apache.sshd.server.session.ServerSession
import org.apache.sshd.server.shell.ProcessShellCommandFactory
+import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BluePrintSshLibConfiguration
import org.springframework.test.context.TestPropertySource
import org.springframework.test.context.junit4.SpringRunner
import java.nio.file.Paths
-import org.junit.runner.RunWith
-import kotlin.test.BeforeTest
import kotlin.test.AfterTest
+import kotlin.test.BeforeTest
import kotlin.test.Test
-import kotlin.test.assertTrue
-import kotlin.test.assertNotNull
import kotlin.test.assertEquals
+import kotlin.test.assertNotNull
+import kotlin.test.assertTrue
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintSshLibConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintSshLibConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
properties =
- ["blueprintsprocessor.sshclient.sample.type=basic-auth",
- "blueprintsprocessor.sshclient.sample.host=localhost",
- "blueprintsprocessor.sshclient.sample.port=52815",
- "blueprintsprocessor.sshclient.sample.username=root",
- "blueprintsprocessor.sshclient.sample.password=dummyps"
- ]
+ [
+ "blueprintsprocessor.sshclient.sample.type=basic-auth",
+ "blueprintsprocessor.sshclient.sample.host=localhost",
+ "blueprintsprocessor.sshclient.sample.port=52815",
+ "blueprintsprocessor.sshclient.sample.username=root",
+ "blueprintsprocessor.sshclient.sample.password=dummyps"
+ ]
)
class BlueprintSshClientServiceTest {
import org.apache.sshd.common.Factory
import org.apache.sshd.server.Environment
-import org.apache.sshd.server.command.Command
import org.apache.sshd.server.ExitCallback
-import java.io.InputStream
-import java.io.OutputStream
-import java.io.IOException
+import org.apache.sshd.server.command.Command
import java.io.BufferedReader
+import java.io.IOException
+import java.io.InputStream
import java.io.InputStreamReader
import java.io.InterruptedIOException
+import java.io.OutputStream
class EchoShellFactory : Factory<Command> {
}
companion object {
+
val INSTANCE = EchoShellFactory()
}
}
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>configs-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Blueprints Processor Resource Configurations API</name>
- <description>Blueprints Processor Resource Configurations API</description>
+ <name>MS Blueprints Processor Modules - Inbound - Configurations API</name>
<dependencies>
<dependency>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
package org.onap.ccsdk.cds.blueprintsprocessor.configs.api
object ConfigsApiDomains {
+
// ConfigsApi Domains Constants
const val CONFIGS_API = "org.onap.ccsdk.cds.blueprintsprocessor.configs.api"
}
@ApiOperation(
value = "Retrieve a resource configuration snapshot.",
notes = "Retrieve a config snapshot, identified by its Resource Id and Type. " +
- "An extra 'format' parameter can be passed to tell what content-type is expected."
+ "An extra 'format' parameter can be passed to tell what content-type is expected."
)
@ResponseBody
@PreAuthorize("hasRole('USER')")
@RequestParam(value = "format", required = false, defaultValue = MediaType.TEXT_PLAIN_VALUE) format: String
):
- ResponseEntity<String> = runBlocking {
+ ResponseEntity<String> = runBlocking {
- var configSnapshot = ""
+ var configSnapshot = ""
- if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
- try {
- configSnapshot = resourceConfigSnapshotService.findByResourceIdAndResourceTypeAndStatus(
- resourceId,
- resourceType, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase())
- )
- } catch (ex: NoSuchElementException) {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
+ if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
+ try {
+ configSnapshot = resourceConfigSnapshotService.findByResourceIdAndResourceTypeAndStatus(
+ resourceId,
+ resourceType, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase())
+ )
+ } catch (ex: NoSuchElementException) {
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
"Could not find configuration snapshot entry for type $resourceType and Id $resourceId",
- ex.errorCauseOrDefault())
- } catch (ex: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
+ ex.errorCauseOrDefault()
+ )
+ } catch (ex: Exception) {
+ throw httpProcessorException(
+ ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
"Could not find configuration snapshot entry for type $resourceType and Id $resourceId",
- ex.errorCauseOrDefault())
+ ex.errorCauseOrDefault()
+ )
+ }
+ } else {
+ throw httpProcessorException(
+ ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
+ "Missing param. You must specify resource-id and resource-type."
+ )
}
- } else {
- throw httpProcessorException(ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
- "Missing param. You must specify resource-id and resource-type.")
- }
- var expectedContentType = format
- if (expectedContentType.indexOf('/') < 0) {
- expectedContentType = "application/$expectedContentType"
- }
- val expectedMediaType: MediaType = MediaType.valueOf(expectedContentType)
+ var expectedContentType = format
+ if (expectedContentType.indexOf('/') < 0) {
+ expectedContentType = "application/$expectedContentType"
+ }
+ val expectedMediaType: MediaType = MediaType.valueOf(expectedContentType)
- ResponseEntity.ok().contentType(expectedMediaType).body(configSnapshot)
- }
+ ResponseEntity.ok().contentType(expectedMediaType).body(configSnapshot)
+ }
@PostMapping(
"/{resourceType}/{resourceId}/{status}",
@ApiOperation(
value = "Store a resource configuration snapshot identified by resourceId, resourceType, status.",
notes = "Store a resource configuration snapshot, identified by its resourceId and resourceType, " +
- "and optionally its status, either RUNNING or CANDIDATE.",
+ "and optionally its status, either RUNNING or CANDIDATE.",
response = ResourceConfigSnapshot::class, produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseBody
}
@RequestMapping(
- path = ["/allByID"],
- method = [RequestMethod.GET],
- produces = [MediaType.APPLICATION_JSON_VALUE]
+ path = ["/allByID"],
+ method = [RequestMethod.GET],
+ produces = [MediaType.APPLICATION_JSON_VALUE]
)
@ApiOperation(
- value = "Retrieve all resource configuration snapshots identified by a given resource_id",
- notes = "Retrieve all config snapshots, identified by its Resource Id, ordered by most recently created/modified date. "
+ value = "Retrieve all resource configuration snapshots identified by a given resource_id",
+ notes = "Retrieve all config snapshots, identified by its Resource Id, ordered by most recently created/modified date. "
)
@ResponseBody
@PreAuthorize("hasRole('USER')")
configSnapshots = resourceConfigSnapshotService.findAllByResourceId(resourceId)
} else {
configSnapshots = resourceConfigSnapshotService.findAllByResourceIdForStatus(
- resourceId, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase()))
+ resourceId, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase())
+ )
}
} catch (ex: NoSuchElementException) {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
- "Could not find configuration snapshot entry for ID $resourceId",
- ex.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
+ "Could not find configuration snapshot entry for ID $resourceId",
+ ex.errorCauseOrDefault()
+ )
} catch (ex: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
- "Unexpected error while finding configuration snapshot entries for ID $resourceId",
- ex.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
+ "Unexpected error while finding configuration snapshot entries for ID $resourceId",
+ ex.errorCauseOrDefault()
+ )
}
val expectedMediaType: MediaType = MediaType.valueOf(JSON_MIME_TYPE)
}
@RequestMapping(
- path = ["allByType"],
- method = [RequestMethod.GET],
- produces = [MediaType.APPLICATION_JSON_VALUE]
+ path = ["allByType"],
+ method = [RequestMethod.GET],
+ produces = [MediaType.APPLICATION_JSON_VALUE]
)
@ApiOperation(
- value = "Retrieve all resource configuration snapshots for a given resource type.",
- notes = "Retrieve all config snapshots matching a specified Resource Type, ordered by most recently created/modified date. "
+ value = "Retrieve all resource configuration snapshots for a given resource type.",
+ notes = "Retrieve all config snapshots matching a specified Resource Type, ordered by most recently created/modified date. "
)
@ResponseBody
@PreAuthorize("hasRole('USER')")
configSnapshots = resourceConfigSnapshotService.findAllByResourceType(resourceType)
} else {
configSnapshots = resourceConfigSnapshotService.findAllByResourceTypeForStatus(
- resourceType, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase()))
+ resourceType, ResourceConfigSnapshot.Status.valueOf(status.toUpperCase())
+ )
}
} catch (ex: NoSuchElementException) {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
- "Could not find configuration snapshot entry for ID $resourceType",
- ex.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, ConfigsApiDomains.CONFIGS_API,
+ "Could not find configuration snapshot entry for ID $resourceType",
+ ex.errorCauseOrDefault()
+ )
} catch (ex: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
- "Unexpected error while finding configuration snapshot entries for type $resourceType",
- ex.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.INVALID_REQUEST_FORMAT, ConfigsApiDomains.CONFIGS_API,
+ "Unexpected error while finding configuration snapshot entries for type $resourceType",
+ ex.errorCauseOrDefault()
+ )
}
val expectedMediaType: MediaType = MediaType.valueOf(JSON_MIME_TYPE)
*/
@RestControllerAdvice("org.onap.ccsdk.cds.blueprintsprocessor.configs.api")
open class ResourceConfigSnapshotExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
- ErrorCatalogExceptionHandler(errorCatalogService)
+ ErrorCatalogExceptionHandler(errorCatalogService)
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
post(resourceType, resourceId, "RUNNING")
webTestClient
- .get()
- .uri("/api/v1/configs/allByID?resourceId=$resourceId")
- .exchange()
- .expectStatus().is2xxSuccessful
- .expectBody()
- .jsonPath("$.length()")
- .isEqualTo(1)
+ .get()
+ .uri("/api/v1/configs/allByID?resourceId=$resourceId")
+ .exchange()
+ .expectStatus().is2xxSuccessful
+ .expectBody()
+ .jsonPath("$.length()")
+ .isEqualTo(1)
}
}
post(resourceType, resourceId, "CANDIDATE")
webTestClient
- .get()
- .uri("/api/v1/configs/allByID?resourceId=$resourceId&status=CANDIDATE")
- .exchange()
- .expectStatus().is2xxSuccessful
- .expectBody()
- .jsonPath("$.length()")
- .isEqualTo(1)
+ .get()
+ .uri("/api/v1/configs/allByID?resourceId=$resourceId&status=CANDIDATE")
+ .exchange()
+ .expectStatus().is2xxSuccessful
+ .expectBody()
+ .jsonPath("$.length()")
+ .isEqualTo(1)
}
}
runBlocking {
webTestClient
- .get()
- .uri("/api/v1/configs/allByID")
- .exchange()
- .expectStatus().is4xxClientError
- .expectBody()
+ .get()
+ .uri("/api/v1/configs/allByID")
+ .exchange()
+ .expectStatus().is4xxClientError
+ .expectBody()
}
}
runBlocking {
webTestClient
- .get()
- .uri("/api/v1/configs/allByID?resourceId=$resourceId&status=NOTGOOD")
- .exchange()
- .expectStatus().is4xxClientError
- .expectBody()
+ .get()
+ .uri("/api/v1/configs/allByID?resourceId=$resourceId&status=NOTGOOD")
+ .exchange()
+ .expectStatus().is4xxClientError
+ .expectBody()
}
}
post(resourceType, "1", "RUNNING")
webTestClient
- .get()
- .uri("/api/v1/configs/allByType?resourceType=$resourceType")
- .exchange()
- .expectStatus().is2xxSuccessful
- .expectBody()
- .jsonPath("$.length()")
- .isEqualTo(3)
+ .get()
+ .uri("/api/v1/configs/allByType?resourceType=$resourceType")
+ .exchange()
+ .expectStatus().is2xxSuccessful
+ .expectBody()
+ .jsonPath("$.length()")
+ .isEqualTo(3)
}
}
runBlocking {
webTestClient
- .get()
- .uri("/api/v1/configs/allByType")
- .exchange()
- .expectStatus().is4xxClientError
- .expectBody()
+ .get()
+ .uri("/api/v1/configs/allByType")
+ .exchange()
+ .expectStatus().is4xxClientError
+ .expectBody()
}
}
runBlocking {
webTestClient
- .get()
- .uri("/api/v1/configs/allByType?resourceType=$resourceType&status=NOTGOOD")
- .exchange()
- .expectStatus().is4xxClientError
- .expectBody()
+ .get()
+ .uri("/api/v1/configs/allByType?resourceType=$resourceType&status=NOTGOOD")
+ .exchange()
+ .expectStatus().is4xxClientError
+ .expectBody()
}
}
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution",
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution",
"org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots",
- "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"],
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>designer-api</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Designer API</name>
- <description>Blueprints Processor Designer API</description>
+ <name>MS Blueprints Processor Modules - Inbound - Designer API</name>
<dependencies>
<dependency>
try {
/** Get the file byte array */
val byteArray = request.fileChunk.chunk.toByteArray()
+
/** Get the Upload Action */
val uploadAction = request.actionIdentifiers?.actionName.emptyTONull()
?: UploadAction.DRAFT.toString()
override fun removeBlueprint(
request: BluePrintRemoveInput,
responseObserver:
- StreamObserver<BluePrintManagementOutput>
+ StreamObserver<BluePrintManagementOutput>
) {
runBlocking {
private fun onError(header: CommonHeader, message: String, error: Exception): BluePrintManagementOutput {
val code = GrpcErrorCodes.code(ErrorCatalogCodes.GENERIC_FAILURE)
return BluePrintManagementOutput.newBuilder()
- .setCommonHeader(header)
- .setStatus(
- Status.newBuilder()
- .setTimestamp(currentTimestamp())
- .setMessage(BluePrintConstants.STATUS_FAILURE)
- .setEventType(EventType.EVENT_COMPONENT_FAILURE)
- .setErrorMessage("Error : $message \n Details: ${error.errorMessageOrDefault()}")
- .setCode(code)
- .build()
- )
- .build()
+ .setCommonHeader(header)
+ .setStatus(
+ Status.newBuilder()
+ .setTimestamp(currentTimestamp())
+ .setMessage(BluePrintConstants.STATUS_FAILURE)
+ .setEventType(EventType.EVENT_COMPONENT_FAILURE)
+ .setErrorMessage("Error : $message \n Details: ${error.errorMessageOrDefault()}")
+ .setCode(code)
+ .build()
+ )
+ .build()
}
private fun onErrorCatalog(header: CommonHeader, message: String, error: BluePrintProcessorException):
- BluePrintManagementOutput {
- val err = if (error.protocol == "") {
- error.grpc(ErrorCatalogCodes.GENERIC_FAILURE)
- } else {
- error.convertToGrpc()
- }
- val errorPayload = errorCatalogService.errorPayload(err.addErrorPayloadMessage(message))
- return BluePrintManagementOutput.newBuilder()
+ BluePrintManagementOutput {
+ val err = if (error.protocol == "") {
+ error.grpc(ErrorCatalogCodes.GENERIC_FAILURE)
+ } else {
+ error.convertToGrpc()
+ }
+ val errorPayload = errorCatalogService.errorPayload(err.addErrorPayloadMessage(message))
+ return BluePrintManagementOutput.newBuilder()
.setCommonHeader(header)
.setStatus(
- Status.newBuilder()
- .setTimestamp(currentTimestamp())
- .setMessage(BluePrintConstants.STATUS_FAILURE)
- .setEventType(EventType.EVENT_COMPONENT_FAILURE)
- .setErrorMessage("Error : ${errorPayload.message}")
- .setCode(errorPayload.code)
- .build()
+ Status.newBuilder()
+ .setTimestamp(currentTimestamp())
+ .setMessage(BluePrintConstants.STATUS_FAILURE)
+ .setEventType(EventType.EVENT_COMPONENT_FAILURE)
+ .setErrorMessage("Error : ${errorPayload.message}")
+ .setCode(errorPayload.code)
+ .build()
)
.build()
- }
+ }
}
@RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption,
@RequestParam(defaultValue = "ASC") sortType: String
): Page<BlueprintModelSearch> {
- val pageRequest = PageRequest.of(offset, limit,
- Sort.Direction.fromString(sortType), sort.columnName)
+ val pageRequest = PageRequest.of(
+ offset, limit,
+ Sort.Direction.fromString(sortType), sort.columnName
+ )
return this.bluePrintModelHandler.allBlueprintModel(pageRequest)
}
@RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption,
@RequestParam(defaultValue = "ASC") sortType: String
): Page<BlueprintModelSearch> {
- val pageRequest = PageRequest.of(offset, limit,
- Sort.Direction.fromString(sortType), sort.columnName)
+ val pageRequest = PageRequest.of(
+ offset, limit,
+ Sort.Direction.fromString(sortType), sort.columnName
+ )
return this.bluePrintModelHandler.searchBluePrintModelsByKeyWordPaged(keyWord, pageRequest)
}
}
@PostMapping(
- "/enrich", produces = [MediaType.APPLICATION_JSON_VALUE], consumes = [MediaType
- .MULTIPART_FORM_DATA_VALUE]
+ "/enrich", produces = [MediaType.APPLICATION_JSON_VALUE],
+ consumes = [
+ MediaType
+ .MULTIPART_FORM_DATA_VALUE
+ ]
)
@ResponseBody
@Throws(BluePrintException::class)
}
@PostMapping(
- "/enrichandpublish", produces = [MediaType.APPLICATION_JSON_VALUE], consumes = [MediaType
- .MULTIPART_FORM_DATA_VALUE]
+ "/enrichandpublish", produces = [MediaType.APPLICATION_JSON_VALUE],
+ consumes = [
+ MediaType
+ .MULTIPART_FORM_DATA_VALUE
+ ]
)
@ResponseBody
@Throws(BluePrintException::class)
}
@PostMapping(
- path = arrayOf("/workflow-spec"), produces = arrayOf(
+ path = arrayOf("/workflow-spec"),
+ produces = arrayOf(
MediaType
.APPLICATION_JSON_VALUE
),
@PreAuthorize("hasRole('USER')")
suspend fun workflowSpec(@RequestBody workFlowSpecReq: WorkFlowSpecRequest):
ResponseEntity<String> = mdcWebCoroutineScope {
- var json = bluePrintModelHandler.prepareWorkFlowSpec(workFlowSpecReq)
- .asJsonString()
- ResponseEntity(json, HttpStatus.OK)
- }
+ var json = bluePrintModelHandler.prepareWorkFlowSpec(workFlowSpecReq)
+ .asJsonString()
+ ResponseEntity(json, HttpStatus.OK)
+ }
@GetMapping(
path = arrayOf(
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
class BootstrapRequest {
+
var loadModelType: Boolean = false
var loadResourceDictionary: Boolean = false
var loadCBA: Boolean = false
}
class WorkFlowsResponse {
+
lateinit var blueprintName: String
var version: String = DEFAULT_VERSION_NUMBER
var workflows: MutableSet<String> = mutableSetOf()
}
class WorkFlowSpecRequest {
+
lateinit var blueprintName: String
var version: String = DEFAULT_VERSION_NUMBER
var returnContent: String = DATA_TYPE_JSON
}
class WorkFlowSpecResponse {
+
lateinit var blueprintName: String
var version: String = DEFAULT_VERSION_NUMBER
lateinit var workFlowData: WorkFlowData
}
class WorkFlowData {
+
lateinit var workFlowName: String
var inputs: MutableMap<String, PropertyDefinition>? = null
var outputs: MutableMap<String, PropertyDefinition>? = null
@RestControllerAdvice("org.onap.ccsdk.cds.blueprintsprocessor.designer.api")
open class DesignerBlueprintExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
- ErrorCatalogExceptionHandler(errorCatalogService)
+ ErrorCatalogExceptionHandler(errorCatalogService)
package org.onap.ccsdk.cds.blueprintsprocessor.designer.api
object DesignerApiDomains {
+
// Designer Api Domains Constants
const val DESIGNER_API = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
const val DESIGNER_API_ENHANCER = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer"
override fun toString(): String {
return "[" + "modelName = " + modelName +
- ", derivedFrom = " + derivedFrom +
- ", definitionType = " + definitionType +
- ", description = " + description +
- ", creationDate = " + creationDate +
- ", version = " + version +
- ", updatedBy = " + updatedBy +
- ", tags = " + tags +
- "]"
+ ", derivedFrom = " + derivedFrom +
+ ", definitionType = " + definitionType +
+ ", description = " + description +
+ ", creationDate = " + creationDate +
+ ", version = " + version +
+ ", updatedBy = " + updatedBy +
+ ", tags = " + tags +
+ "]"
}
companion object {
+
private const val serialVersionUID = 1L
}
}
override fun toString(): String {
return "[" + ", name = " + name +
- ", dataType = " + dataType +
- ", entrySchema = " + entrySchema +
- ", resourceDictionaryGroup = " + resourceDictionaryGroup +
- ", definition =" + definition +
- ", description = " + description +
- ", updatedBy = " + updatedBy +
- ", tags = " + tags +
- ", creationDate = " + creationDate +
- "]"
+ ", dataType = " + dataType +
+ ", entrySchema = " + entrySchema +
+ ", resourceDictionaryGroup = " + resourceDictionaryGroup +
+ ", definition =" + definition +
+ ", description = " + description +
+ ", updatedBy = " + updatedBy +
+ ", tags = " + tags +
+ ", creationDate = " + creationDate +
+ "]"
}
companion object {
+
private const val serialVersionUID = 1L
}
}
BluePrintArtifactDefinitionEnhancer {
companion object {
+
const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource"
}
if (!alreadyEnhanced) {
val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(artifactFilePath, ResourceAssignment::class.java)
- as? MutableList<ResourceAssignment>
+ as? MutableList<ResourceAssignment>
?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($artifactFilePath)")
// Call Resource Assignment Enhancer
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService
+import org.onap.ccsdk.cds.controllerblueprints.core.logger
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils.ResourceDictionaryUtils
}
} catch (e: BluePrintProcessorException) {
val errorMsg = "Error while enriching the CBA package."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong blueprint definitions or resource definitions.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong blueprint definitions or resource definitions."
+ )
} catch (e: IOException) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "IO Error: CBA file failed enrichment - ${e.message}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "IO Error: CBA file failed enrichment - ${e.message}", e.errorCauseOrDefault()
+ )
} catch (e: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "Error in Enriching CBA: ${e.message}", e.errorCauseOrDefault())
- }
- return blueprintRuntimeService.bluePrintContext()
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "Error in Enriching CBA: ${e.message}", e.errorCauseOrDefault()
+ )
}
+ return blueprintRuntimeService.bluePrintContext()
+ }
}
val relationShipTypeName = requirementDefinition.relationship
?: throw BluePrintException(
"couldn't get relationship name for the NodeType($nodeTypeName) " +
- "Requirement($requirementName)"
+ "Requirement($requirementName)"
)
enrichRelationShipType(relationShipTypeName)
}
private val log = logger(BluePrintWorkflowEnhancerImpl::class)
companion object {
+
const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource"
const val PROPERTY_DEPENDENCY_NODE_TEMPLATES = "dependency-node-templates"
}
else -> {
throw BluePrintProcessorException(
"couldn't execute workflow($name) step mapped " +
- "to node template($firstNodeTemplateName) derived from($derivedFrom)"
+ "to node template($firstNodeTemplateName) derived from($derivedFrom)"
)
}
}
val resourceAssignmentArtifacts = bluePrintContext.nodeTemplateByName(componentNodeTemplateName)
.artifacts?.filter {
- it.value.type == ARTIFACT_TYPE_MAPPING_SOURCE
- }?.map {
- log.info("resource assignment artifacts(${it.key}) for NodeType($componentNodeTemplateName)")
- it.value.file
- }
+ it.value.type == ARTIFACT_TYPE_MAPPING_SOURCE
+ }?.map {
+ log.info("resource assignment artifacts(${it.key}) for NodeType($componentNodeTemplateName)")
+ it.value.file
+ }
resourceAssignmentArtifacts
}?.flatten()
val resourceAssignmentProperties: MutableMap<String, PropertyDefinition> = hashMapOf()
val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(filePath, ResourceAssignment::class.java)
- as? MutableList<ResourceAssignment>
+ as? MutableList<ResourceAssignment>
?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)")
val alreadyEnhancedKey = "enhanced-$fileName"
}
private fun checkResourceDefinitionNeeded(resourceAssignment: ResourceAssignment): Boolean {
- return !((resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_INPUT) ||
- resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_DEFAULT)) &&
- BluePrintTypes.validPrimitiveOrCollectionPrimitive(resourceAssignment.property!!))
+ return !(
+ (
+ resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_INPUT) ||
+ resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_DEFAULT)
+ ) &&
+ BluePrintTypes.validPrimitiveOrCollectionPrimitive(resourceAssignment.property!!)
+ )
}
private fun getResourceDefinition(name: String): ResourceDefinition {
private val log = logger(ResourceDefinitionEnhancerService::class)
companion object {
+
const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource"
}
// Read the Resource Definitions from the Database and write to type file.
private fun generateResourceDictionary(blueprintBasePath: String, resourceAssignments: List<ResourceAssignment>):
- List<ResourceDefinition> {
- val resourceKeys = resourceAssignments.mapNotNull { it.dictionaryName }.distinct().sorted()
- log.info("distinct resource keys ($resourceKeys)")
+ List<ResourceDefinition> {
+ val resourceKeys = resourceAssignments.mapNotNull { it.dictionaryName }.distinct().sorted()
+ log.info("distinct resource keys ($resourceKeys)")
- // TODO("Optimise DB single Query to multiple Query")
- return resourceKeys.map { resourceKey ->
- getResourceDefinition(resourceKey)
+ // TODO("Optimise DB single Query to multiple Query")
+ return resourceKeys.map { resourceKey ->
+ getResourceDefinition(resourceKey)
+ }
}
- }
private fun enrichResourceDefinitionSources(
bluePrintContext: BluePrintContext,
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelContentRepository
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelRepository
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelSearchRepository
-import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BootstrapRequest
+import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains
+import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowData
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowSpecRequest
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowSpecResponse
-import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowData
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowsResponse
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load.BluePrintDatabaseLoadService
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
-import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
-import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
-import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir
import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
+import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir
+import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService
+import org.onap.ccsdk.cds.controllerblueprints.core.logger
+import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
+import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
open suspend fun bootstrapBlueprint(bootstrapRequest: BootstrapRequest) {
log.info(
"Bootstrap request with type load(${bootstrapRequest.loadModelType}), " +
- "resource dictionary load(${bootstrapRequest.loadResourceDictionary}) and " +
- "cba load(${bootstrapRequest.loadCBA})"
+ "resource dictionary load(${bootstrapRequest.loadResourceDictionary}) and " +
+ "cba load(${bootstrapRequest.loadCBA})"
)
if (bootstrapRequest.loadModelType) {
bluePrintDatabaseLoadService.initModelTypes()
@Throws(BluePrintException::class)
open suspend fun prepareWorkFlowSpec(req: WorkFlowSpecRequest):
- WorkFlowSpecResponse {
- val basePath = blueprintsProcessorCatalogService.getFromDatabase(req
- .blueprintName, req.version)
- log.info("blueprint base path $basePath")
-
- val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(basePath.toString())
- val workFlow = blueprintContext.workflowByName(req.workflowName)
-
- val wfRes = WorkFlowSpecResponse()
- wfRes.blueprintName = req.blueprintName
- wfRes.version = req.version
-
- val workFlowData = WorkFlowData()
- workFlowData.workFlowName = req.workflowName
- workFlowData.inputs = workFlow.inputs
- workFlowData.outputs = workFlow.outputs
- wfRes.workFlowData = workFlowData
-
- if (workFlow.inputs != null) {
- for ((k, v) in workFlow.inputs!!) {
- addPropertyInfo(k, v, blueprintContext, wfRes)
+ WorkFlowSpecResponse {
+ val basePath = blueprintsProcessorCatalogService.getFromDatabase(
+ req
+ .blueprintName,
+ req.version
+ )
+ log.info("blueprint base path $basePath")
+
+ val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(basePath.toString())
+ val workFlow = blueprintContext.workflowByName(req.workflowName)
+
+ val wfRes = WorkFlowSpecResponse()
+ wfRes.blueprintName = req.blueprintName
+ wfRes.version = req.version
+
+ val workFlowData = WorkFlowData()
+ workFlowData.workFlowName = req.workflowName
+ workFlowData.inputs = workFlow.inputs
+ workFlowData.outputs = workFlow.outputs
+ wfRes.workFlowData = workFlowData
+
+ if (workFlow.inputs != null) {
+ for ((k, v) in workFlow.inputs!!) {
+ addPropertyInfo(k, v, blueprintContext, wfRes)
+ }
}
- }
- if (workFlow.outputs != null) {
- for ((k, v) in workFlow.outputs!!) {
- addPropertyInfo(k, v, blueprintContext, wfRes)
+ if (workFlow.outputs != null) {
+ for ((k, v) in workFlow.outputs!!) {
+ addPropertyInfo(k, v, blueprintContext, wfRes)
+ }
}
- }
- return wfRes
- }
+ return wfRes
+ }
private fun addPropertyInfo(propName: String, prop: PropertyDefinition, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
updatePropertyInfo(propName, prop, ctx, res)
}
}
}
+
private fun addDataType(name: String, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
var data = ctx.dataTypeByName(name)
if (data != null) {
@Throws(BluePrintException::class)
open suspend fun getWorkflowNames(name: String, version: String): WorkFlowsResponse {
val basePath = blueprintsProcessorCatalogService.getFromDatabase(
- name, version)
+ name, version
+ )
log.info("blueprint base path $basePath")
var res = WorkFlowsResponse()
res.version = version
val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(
- basePath.toString())
+ basePath.toString()
+ )
if (blueprintContext.workflows() != null) {
res.workflows = blueprintContext.workflows()!!.keys
}
* This is a getAllBlueprintModel method to retrieve all the BlueprintModel in Database
*
* @return List<BlueprintModelSearch> list of the controller blueprint archives
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
open fun allBlueprintModel(): List<BlueprintModelSearch> {
return blueprintModelSearchRepository.findAll()
}
* This is a getAllBlueprintModel method to retrieve all the BlueprintModel in Database
*
* @return List<BlueprintModelSearch> list of the controller blueprint archives
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
open fun allBlueprintModel(pageRequest: Pageable): Page<BlueprintModelSearch> {
return blueprintModelSearchRepository.findAll(pageRequest)
}
* @param filePart filePart
* @return Mono<BlueprintModelSearch>
* @throws BluePrintException BluePrintException
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
@Throws(BluePrintException::class)
open suspend fun saveBlueprintModel(filePart: FilePart): BlueprintModelSearch {
try {
return upload(filePart, false)
} catch (e: IOException) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "Error in Save CBA: ${e.message}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "Error in Save CBA: ${e.message}", e.errorCauseOrDefault()
+ )
}
}
*
* @param tags tags
* @return List<BlueprintModelSearch>
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
open fun searchBlueprintModels(tags: String): List<BlueprintModelSearch> {
return blueprintModelSearchRepository.findByTagsContainingIgnoreCase(tags)
}
@Throws(BluePrintException::class)
open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch? {
return blueprintModelSearchRepository.findByArtifactNameAndArtifactVersion(name, version)
- /*?: throw BluePrintException(
- ErrorCode.RESOURCE_NOT_FOUND.value,
- String.format(BLUEPRINT_MODEL_NAME_VERSION_FAILURE_MSG, name, version)
- )*/
+ /*?: throw BluePrintException(
+ ErrorCode.RESOURCE_NOT_FOUND.value,
+ String.format(BLUEPRINT_MODEL_NAME_VERSION_FAILURE_MSG, name, version)
+ )*/
}
/**
* @param version version
* @return ResponseEntity<Resource>
* @throws BluePrintException BluePrintException
- </Resource> */
+ </Resource> */
@Throws(BluePrintException::class)
open fun downloadBlueprintModelFileByNameAndVersion(
name: String,
} catch (e: BluePrintProcessorException) {
e.http(ErrorCatalogCodes.RESOURCE_NOT_FOUND)
val errorMsg = "Error while downloading the CBA file by Blueprint Name ($name) and Version ($version)."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong resource definition or resolution failed.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong resource definition or resolution failed."
+ )
}
}
*
* @return ResponseEntity<Resource>
* @throws BluePrintException BluePrintException
- </Resource> */
+ </Resource> */
@Throws(BluePrintException::class)
open fun downloadBlueprintModelFile(id: String): ResponseEntity<Resource> {
val blueprintModel: BlueprintModel
try {
blueprintModel = getBlueprintModel(id)
} catch (e: BluePrintException) {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- "Error while downloading the CBA file: couldn't get blueprint modelby ID ($id)",
- e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ "Error while downloading the CBA file: couldn't get blueprint modelby ID ($id)",
+ e.errorCauseOrDefault()
+ )
}
val fileName = "${blueprintModel.artifactName}_${blueprintModel.artifactVersion}.zip"
val file = blueprintModel.blueprintModelContent?.content
- ?: throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- "Error while downloading the CBA file: couldn't get model content")
+ ?: throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ "Error while downloading the CBA file: couldn't get model content"
+ )
return prepareResourceEntity(fileName, file)
}
/**
* @return ResponseEntity<Resource>
- </Resource> */
+ </Resource> */
private fun prepareResourceEntity(fileName: String, file: ByteArray): ResponseEntity<Resource> {
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType("text/plain"))
@Throws(BluePrintException::class)
open fun getBlueprintModelSearch(id: String): BlueprintModelSearch {
return blueprintModelSearchRepository.findById(id)
- ?: throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- String.format(BLUEPRINT_MODEL_ID_FAILURE_MSG, id))
+ ?: throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ String.format(BLUEPRINT_MODEL_ID_FAILURE_MSG, id)
+ )
}
/**
* @param keyWord
*
* @return List<BlueprintModelSearch> list of the controller blueprint
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
open fun searchBluePrintModelsByKeyWord(keyWord: String): List<BlueprintModelSearch> {
return blueprintModelSearchRepository.findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(
keyWord, keyWord, keyWord, keyWord, keyWord
* @param keyWord
*
* @return List<BlueprintModelSearch> list of the controller blueprint
- </BlueprintModelSearch> */
+ </BlueprintModelSearch> */
open fun searchBluePrintModelsByKeyWordPaged(keyWord: String, pageRequest: PageRequest): Page<BlueprintModelSearch> {
return blueprintModelSearchRepository.findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase(
keyWord,
} catch (e: BluePrintProcessorException) {
e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT)
val errorMsg = "Error while enhancing the CBA package."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong CBA file provided, please verify and enrich Again.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong CBA file provided, please verify and enrich Again."
+ )
} catch (e: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "EnrichBlueprint: ${e.message}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "EnrichBlueprint: ${e.message}", e.errorCauseOrDefault()
+ )
}
}
} catch (e: BluePrintProcessorException) {
e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT)
val errorMsg = "Error in Publishing CBA."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong CBA provided, please verify and enrich your CBA.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong CBA provided, please verify and enrich your CBA."
+ )
} catch (e: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "Error in Publishing CBA: ${e.message}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "Error in Publishing CBA: ${e.message}", e.errorCauseOrDefault()
+ )
}
}
} catch (e: BluePrintProcessorException) {
e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT)
val errorMsg = "Error while enhancing and uploading the CBA package."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong CBA file provided, please verify the source CBA.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong CBA file provided, please verify the source CBA."
+ )
} catch (e: Exception) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "EnrichBlueprint: ${e.message}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "EnrichBlueprint: ${e.message}", e.errorCauseOrDefault()
+ )
}
}
val blueprintId = blueprintsProcessorCatalogService.saveToDatabase(saveId, compressedFile, validate)
return blueprintModelSearchRepository.findById(blueprintId)
- ?: throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- String.format(BLUEPRINT_MODEL_ID_FAILURE_MSG, blueprintId))
+ ?: throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ String.format(BLUEPRINT_MODEL_ID_FAILURE_MSG, blueprintId)
+ )
} catch (e: BluePrintException) {
e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT)
val errorMsg = "Error in Upload CBA."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong enriched CBA.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong enriched CBA."
+ )
} catch (e: IOException) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "Error in Upload CBA: ${e.errorMessageOrDefault()}", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "Error in Upload CBA: ${e.errorMessageOrDefault()}", e.errorCauseOrDefault()
+ )
} finally {
// Clean blueprint script cache
val cacheKey = BluePrintFileUtils
try {
val blueprintModel = getBlueprintModelByNameAndVersion(name, version)
return blueprintModel.blueprintModelContent?.content
- ?: throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- "Error while downloading the CBA file: couldn't get model content")
+ ?: throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ "Error while downloading the CBA file: couldn't get model content"
+ )
} catch (e: BluePrintException) {
e.http(ErrorCatalogCodes.RESOURCE_NOT_FOUND)
val errorMsg = "Fail to get Blueprint Model content."
- throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg,
- "Wrong name and version was provide.")
+ throw e.updateErrorMessage(
+ DesignerApiDomains.DESIGNER_API, errorMsg,
+ "Wrong name and version was provide."
+ )
}
}
val blueprintWorkingDir = normalizedPathName(bluePrintLoadConfiguration.blueprintWorkingPath, enhanceId)
try {
when (fileSource) {
- is FilePart -> BluePrintEnhancerUtils
- .copyFilePartToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir)
- is ByteArray -> BluePrintEnhancerUtils
- .copyByteArrayToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir)
+ is FilePart ->
+ BluePrintEnhancerUtils
+ .copyFilePartToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir)
+ is ByteArray ->
+ BluePrintEnhancerUtils
+ .copyByteArrayToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir)
} // Enhance the Blue Prints
bluePrintEnhancerService.enhance(blueprintWorkingDir)
val errorMsg = "Fail Enriching the CBA."
throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg)
} catch (e: IOException) {
- throw httpProcessorException(ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
- "Error while Enriching the CBA file.", e.errorCauseOrDefault())
+ throw httpProcessorException(
+ ErrorCatalogCodes.IO_FILE_INTERRUPT, DesignerApiDomains.DESIGNER_API,
+ "Error while Enriching the CBA file.", e.errorCauseOrDefault()
+ )
} finally {
BluePrintEnhancerUtils.cleanEnhancer(blueprintArchive, blueprintWorkingDir)
}
return if (modelType != null) {
modelType
} else {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- "couldn't get modelType($modelTypeName)")
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ "couldn't get modelType($modelTypeName)"
+ )
}
}
*
* @param tags tags
* @return List<ModelType>
- </ModelType> */
+ </ModelType> */
suspend fun searchModelTypes(tags: String): List<ModelType> {
check(tags.isNotBlank()) { "No Search Information provide" }
return modelTypeRepository.findByTagsContainingIgnoreCase(tags)
return if (resourceDictionaryDb != null) {
resourceDictionaryDb
} else {
- throw httpProcessorException(ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
- String.format("couldn't get resource dictionary for name (%s)", name))
+ throw httpProcessorException(
+ ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API,
+ String.format("couldn't get resource dictionary for name (%s)", name)
+ )
}
}
*
* @param names names
* @return List<ResourceDictionary>
- </ResourceDictionary> */
+ </ResourceDictionary> */
suspend fun searchResourceDictionaryByNames(names: List<String>): List<ResourceDictionary> {
Preconditions.checkArgument(CollectionUtils.isNotEmpty(names), "No Search Information provide")
return resourceDictionaryRepository.findByNameIn(names)
*
* @param tags tags
* @return List<ResourceDictionary>
- </ResourceDictionary> */
+ </ResourceDictionary> */
suspend fun searchResourceDictionaryByTags(tags: String): List<ResourceDictionary> {
Preconditions.checkArgument(StringUtils.isNotBlank(tags), "No search tag information provide")
return resourceDictionaryRepository.findByTagsContainingIgnoreCase(tags)
resourceDictionary.resourceDictionaryGroup = resourceDefinition.group
resourceDictionary.entrySchema = resourceDefinition.property.entrySchema?.type
if (StringUtils.isBlank(resourceDefinition.tags)) {
- resourceDictionary.tags = (resourceDefinition.name + ", " + resourceDefinition.updatedBy +
- ", " + resourceDefinition.updatedBy)
+ resourceDictionary.tags = (
+ resourceDefinition.name + ", " + resourceDefinition.updatedBy +
+ ", " + resourceDefinition.updatedBy
+ )
} else {
resourceDictionary.tags = resourceDefinition.tags!!
}
*
* @param name name
* @return Optional<ResourceMapping>
- </ResourceMapping> */
+ </ResourceMapping> */
fun findByName(name: String): ResourceDictionary?
/**
*
* @param names names
* @return Optional<ResourceMapping>
- </ResourceMapping> */
+ </ResourceMapping> */
fun findByNameIn(names: List<String>): List<ResourceDictionary>
/**
*
* @param tags tags
* @return Optional<ModelType>
- </ModelType> */
+ </ModelType> */
fun findByTagsContainingIgnoreCase(tags: String): List<ResourceDictionary>
/**
}
companion object {
+
private val log = LoggerFactory.getLogger(ApplicationRegistrationService::class.java)
}
}
class BluePrintEnhancerUtils {
companion object {
+
val log = logger(BluePrintEnhancerUtils)
fun populateDataTypes(
outputFileName: String = "enhanced-cba.zip"
):
ResponseEntity<Resource> {
- val compressedFile = normalizedFile(archiveDir, outputFileName)
- BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
- return prepareResourceEntity(compressedFile)
- }
+ val compressedFile = normalizedFile(archiveDir, outputFileName)
+ BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
+ return prepareResourceEntity(compressedFile)
+ }
/** convert [file] to ResourceEntity */
suspend fun prepareResourceEntity(file: File): ResponseEntity<Resource> {
class ModelTypeValidator {
companion object {
+
/**
* This is a validateModelTypeDefinition
*
private val log = logger(BlueprintModelControllerTest::class)
companion object {
+
private var bp: BlueprintModelSearch? = null
}
fun test01_saveBluePrint() {
bp = runBlocking {
val body = MultipartBodyBuilder().apply {
- part("file", object : ByteArrayResource(testZipFile!!.readBytes()) {
- override fun getFilename(): String {
- return "test.zip"
+ part(
+ "file",
+ object : ByteArrayResource(testZipFile!!.readBytes()) {
+ override fun getFilename(): String {
+ return "test.zip"
+ }
}
- })
+ )
}.build()
val saveBP = webTestClient
fun test07_publishBlueprintModel() {
bp = runBlocking {
val body = MultipartBodyBuilder().apply {
- part("file", object : ByteArrayResource(testZipFile!!.readBytes()) {
- override fun getFilename(): String {
- return "test.zip"
+ part(
+ "file",
+ object : ByteArrayResource(testZipFile!!.readBytes()) {
+ override fun getFilename(): String {
+ return "test.zip"
+ }
}
- })
+ )
}.build()
val publishBP = webTestClient
webTestClient.delete().uri("/api/v1/blueprint-model/name/${bp!!.artifactName}/version/${bp!!.artifactVersion}")
.header(
- "Authorization", "Basic " + Base64Utils
+ "Authorization",
+ "Basic " + Base64Utils
.encodeToString(("ccsdkapps" + ":" + "ccsdkapps").toByteArray(UTF_8))
)
.exchange()
webTestClient.method(requestMethod).uri(uri)
.header(
- "Authorization", "Basic " + Base64Utils
+ "Authorization",
+ "Basic " + Base64Utils
.encodeToString(("ccsdkapps" + ":" + "ccsdkapps").toByteArray(UTF_8))
)
.body(body)
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.controllerblueprints",
+ basePackages = [
+ "org.onap.ccsdk.cds.controllerblueprints",
"org.onap.ccsdk.cds.blueprintsprocessor.designer.api",
- "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"]
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary"
+ ]
)
@EnableAutoConfiguration
open class DesignerApiTestConfiguration
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
modelType.definition = JacksonUtils.jsonNode(content)
modelType.modelName = modelName
modelType.version = "1.0.0"
- modelType.tags = ("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
- BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)
+ modelType.tags = (
+ "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
+ BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE
+ )
modelType.updatedBy = "xxxxxx@xxx.com"
modelType = modelTypeController.saveModelType(modelType)
log.info("Saved Mode {}", modelType.toString())
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
- "org.onap.ccsdk.cds.blueprintsprocessor.designer.api"],
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
+ "org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
modelType.definition = JacksonUtils.jsonNode(content)
modelType.modelName = modelName
modelType.version = "1.0.0"
- modelType.tags = ("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
- BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)
+ modelType.tags = (
+ "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
+ BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE
+ )
modelType.updatedBy = "xxxxxx@xxx.com"
modelType = modelTypeHandler!!.saveModel(modelType)
log.info("Saved Mode {}", modelType.toString())
@Test
fun testSaveResourceDictionary() {
val resourceDefinition: ResourceDefinition = JacksonUtils
- .readValueFromFile(
- "./../../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json",
- ResourceDefinition::class.java
- )!!
+ .readValueFromFile(
+ "./../../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json",
+ ResourceDefinition::class.java
+ )!!
val expectedResourceDictionary = ResourceDictionary()
expectedResourceDictionary.name = resourceDefinition.name
val mockReturnValue = ResourceDictionary()
mockReturnValue.definition = ResourceDefinition()
Mockito.`when`(mockRepository.save(any(ResourceDictionary::class.java)))
- .thenReturn(mockReturnValue)
+ .thenReturn(mockReturnValue)
runBlocking {
resourceDictionaryHandler.saveResourceDefinition(resourceDefinition)
import java.nio.file.Path
class MockFilePart(private val fileName: String) : FilePart {
+
val log = LoggerFactory.getLogger(MockFilePart::class.java)!!
override fun content(): Flux<DataBuffer> {
TODO("not implemented") // To change body of created functions use File | Settings | File Templates.
modelType.definition = JacksonUtils.jsonNode(content)
modelType.modelName = modelName
modelType.version = "1.0.0"
- modelType.tags = ("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
- BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)
+ modelType.tags = (
+ "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," +
+ BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE
+ )
modelType.updatedBy = "xxxxxx@xxx.com"
val dbModelType = modelTypeReactRepository!!.save(modelType).block()
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api-common</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Health API common</name>
- <description>checking system check health endpoints</description>
+ <name>MS Blueprints Processor Modules - Inbound - Health API common</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>rest-lib</artifactId>
</dependency>
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Health API</name>
- <description>checking system check health endpoints</description>
+ <name>MS Blueprints Processor Modules - Inbound - Health API</name>
<dependencies>
-
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api-common</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${ccsdk.cds.version}</version>
</dependency>
</dependencies>
</project>
*/
package org.onap.ccsdk.cds.blueprintsprocessor.healthapi
-
+/*
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration
import org.springframework.test.context.TestPropertySource
import org.springframework.test.context.junit4.SpringRunner
import org.springframework.test.web.reactive.server.WebTestClient
+*/
/**
*Unit tests for making sure that two endpoints is up and running
* @author Shaaban Ebrahim
* @version 1.0
*/
+/*
@RunWith(SpringRunner::class)
@WebFluxTest
@ContextConfiguration(
.expectStatus().is2xxSuccessful
}
}
+
+*/
+
+class HealthCheckApplicationTests
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>modules</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-modules</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <artifactId>inbounds</artifactId>
+ <artifactId>modules-inbounds</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Inbounds POM</name>
- <description>Blueprints Processor Inbounds</description>
+ <name>MS Blueprints Processor Modules - Inbounds</name>
<modules>
<module>configs-api</module>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>workflow-service</artifactId>
</dependency>
<dependency>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>resource-api</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Resource API</name>
- <description>Blueprints Processor Resource API</description>
+ <name>MS Blueprints Processor Modules - Inbound - Resource API</name>
<dependencies>
<dependency>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
package org.onap.ccsdk.cds.blueprintsprocessor.resource.api
object ResourceApiDomains {
+
// Resource Api Domains Constants
const val RESOURCE_API = "org.onap.ccsdk.cds.blueprintsprocessor.resource.api"
}
@ApiOperation(
value = "Get all resolved resources using the resolution key. ",
notes = "Retrieve all stored resolved resources using the blueprint name, blueprint version, " +
- "artifact name and the resolution-key.",
+ "artifact name and the resolution-key.",
response = ResourceResolution::class,
responseContainer = "List",
produces = MediaType.APPLICATION_JSON_VALUE
@ApiParam(value = "Resource Id associated with the resolution.", required = false)
@RequestParam(value = "resourceId", required = false, defaultValue = "") resourceId: String
):
- ResponseEntity<List<ResourceResolution>> = runBlocking {
+ ResponseEntity<List<ResourceResolution>> = runBlocking {
- if ((resolutionKey.isNotEmpty() || artifactName.isNotEmpty()) && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) {
- throw httpProcessorException(ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
- "Either retrieve resolved value using artifact name and resolution-key OR using resource-id and resource-type.")
- } else if (resolutionKey.isNotEmpty() && artifactName.isNotEmpty()) {
- ResponseEntity.ok()
- .body(resourceResolutionDBService.readWithResolutionKey(bpName, bpVersion, artifactName, resolutionKey))
- } else if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
- ResponseEntity.ok()
- .body(
- resourceResolutionDBService.readWithResourceIdAndResourceType(
- bpName,
- bpVersion,
- resourceId,
- resourceType
+ if ((resolutionKey.isNotEmpty() || artifactName.isNotEmpty()) && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) {
+ throw httpProcessorException(
+ ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
+ "Either retrieve resolved value using artifact name and resolution-key OR using resource-id and resource-type."
+ )
+ } else if (resolutionKey.isNotEmpty() && artifactName.isNotEmpty()) {
+ ResponseEntity.ok()
+ .body(resourceResolutionDBService.readWithResolutionKey(bpName, bpVersion, artifactName, resolutionKey))
+ } else if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
+ ResponseEntity.ok()
+ .body(
+ resourceResolutionDBService.readWithResourceIdAndResourceType(
+ bpName,
+ bpVersion,
+ resourceId,
+ resourceType
+ )
)
+ } else {
+ throw httpProcessorException(
+ ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
+ "Missing param. Either retrieve resolved value using artifact name and resolution-key OR using resource-id and resource-type."
)
- } else {
- throw httpProcessorException(ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
- "Missing param. Either retrieve resolved value using artifact name and resolution-key OR using resource-id and resource-type.")
+ }
}
- }
@RequestMapping(
- path = [""],
- method = [RequestMethod.DELETE], produces = [MediaType.APPLICATION_JSON_VALUE]
+ path = [""],
+ method = [RequestMethod.DELETE], produces = [MediaType.APPLICATION_JSON_VALUE]
+ )
+ @ApiOperation(
+ value = "Delete resources using resolution key",
+ notes = "Delete all the resources associated to a resolution-key using blueprint metadata, artifact name and the resolution-key.",
+ produces = MediaType.APPLICATION_JSON_VALUE
)
- @ApiOperation(value = "Delete resources using resolution key",
- notes = "Delete all the resources associated to a resolution-key using blueprint metadata, artifact name and the resolution-key.",
- produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasRole('USER')")
fun deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(
@ApiParam(value = "Name of the CBA.", required = true)
@RequestParam(value = "resolutionKey", required = true) resolutionKey: String
) = runBlocking {
ResponseEntity.ok()
- .body(resourceResolutionDBService.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(bpName, bpVersion, artifactName, resolutionKey))
+ .body(
+ resourceResolutionDBService.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(
+ bpName,
+ bpVersion,
+ artifactName,
+ resolutionKey
+ )
+ )
}
@RequestMapping(
@ApiParam(value = "Name of the resource to retrieve.", required = true)
@RequestParam(value = "name", required = true) name: String
):
- ResponseEntity<ResourceResolution> = runBlocking {
+ ResponseEntity<ResourceResolution> = runBlocking {
- ResponseEntity.ok()
- .body(resourceResolutionDBService.readValue(bpName, bpVersion, artifactName, resolutionKey, name))
- }
+ ResponseEntity.ok()
+ .body(resourceResolutionDBService.readValue(bpName, bpVersion, artifactName, resolutionKey, name))
+ }
}
*/
@RestControllerAdvice("org.onap.ccsdk.cds.blueprintsprocessor.resource.api")
open class ResourceExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
- ErrorCatalogExceptionHandler(errorCatalogService)
+ ErrorCatalogExceptionHandler(errorCatalogService)
@ApiOperation(
value = "Retrieve a resolved template.",
notes = "Retrieve a config template for a given CBA's action, identified by its blueprint name, blueprint version, " +
- "artifact name and resolution key. An extra 'format' parameter can be passed to tell what content-type" +
- " to expect in return"
+ "artifact name and resolution key. An extra 'format' parameter can be passed to tell what content-type" +
+ " to expect in return"
)
@ResponseBody
@PreAuthorize("hasRole('USER')")
@ApiParam(value = "Occurrence of the template resolution (1-n).", required = false)
@RequestParam(value = "occurrence", required = false, defaultValue = "1") occurrence: Int = 1
):
- ResponseEntity<String> = runBlocking {
+ ResponseEntity<String> = runBlocking {
- var result = ""
+ var result = ""
- if ((resolutionKey.isNotEmpty() || artifactName.isNotEmpty()) && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) {
- throw httpProcessorException(ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
- "Either retrieve resolved template using artifact name and resolution-key OR using resource-id and resource-type.")
- } else if (resolutionKey.isNotEmpty() && artifactName.isNotEmpty()) {
- result = templateResolutionService.findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName(
- bpName,
- bpVersion,
- artifactName,
- resolutionKey,
- occurrence
- )
- } else if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
- result =
- templateResolutionService.findByResoureIdAndResourceTypeAndBlueprintNameAndBlueprintVersionAndArtifactName(
+ if ((resolutionKey.isNotEmpty() || artifactName.isNotEmpty()) && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) {
+ throw httpProcessorException(
+ ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
+ "Either retrieve resolved template using artifact name and resolution-key OR using resource-id and resource-type."
+ )
+ } else if (resolutionKey.isNotEmpty() && artifactName.isNotEmpty()) {
+ result = templateResolutionService.findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName(
bpName,
bpVersion,
artifactName,
- resourceId,
- resourceType,
+ resolutionKey,
occurrence
)
- } else {
- throw httpProcessorException(ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
- "Missing param. Either retrieve resolved template using artifact name and resolution-key OR using resource-id and resource-type.")
- }
+ } else if (resourceType.isNotEmpty() && resourceId.isNotEmpty()) {
+ result =
+ templateResolutionService.findByResoureIdAndResourceTypeAndBlueprintNameAndBlueprintVersionAndArtifactName(
+ bpName,
+ bpVersion,
+ artifactName,
+ resourceId,
+ resourceType,
+ occurrence
+ )
+ } else {
+ throw httpProcessorException(
+ ErrorCatalogCodes.REQUEST_NOT_FOUND, ResourceApiDomains.RESOURCE_API,
+ "Missing param. Either retrieve resolved template using artifact name and resolution-key OR using resource-id and resource-type."
+ )
+ }
- var expectedContentType = format
- if (expectedContentType.indexOf('/') < 0) {
- expectedContentType = "application/$expectedContentType"
- }
- val expectedMediaType: MediaType = MediaType.valueOf(expectedContentType)
+ var expectedContentType = format
+ if (expectedContentType.indexOf('/') < 0) {
+ expectedContentType = "application/$expectedContentType"
+ }
+ val expectedMediaType: MediaType = MediaType.valueOf(expectedContentType)
- ResponseEntity.ok().contentType(expectedMediaType).body(result)
- }
+ ResponseEntity.ok().contentType(expectedMediaType).body(result)
+ }
@PostMapping("/{bpName}/{bpVersion}/{artifactName}/{resolutionKey}", produces = [MediaType.APPLICATION_JSON_VALUE])
@ApiOperation(
value = "Store a resolved template w/ resolution-key",
notes = "Store a template for a given CBA's action, identified by its blueprint name, blueprint version, " +
- "artifact name and resolution key.",
+ "artifact name and resolution key.",
response = TemplateResolution::class,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Store a resolved template w/ resourceId and resourceType",
notes = "Store a template for a given CBA's action, identified by its blueprint name, blueprint version, " +
- "artifact name, resourceId and resourceType.",
+ "artifact name, resourceId and resourceType.",
response = TemplateResolution::class,
produces = MediaType.APPLICATION_JSON_VALUE
)
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
@RunWith(SpringRunner::class)
@WebFluxTest
@ContextConfiguration(
- classes = [TestDatabaseConfiguration::class, ErrorCatalogTestConfiguration::class,
- ResourceController::class, ResourceResolutionDBService::class]
+ classes = [
+ TestDatabaseConfiguration::class, ErrorCatalogTestConfiguration::class,
+ ResourceController::class, ResourceResolutionDBService::class
+ ]
)
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.controllerblueprints.core.service",
+ basePackages = [
+ "org.onap.ccsdk.cds.controllerblueprints.core.service",
"org.onap.ccsdk.cds.blueprintsprocessor.resource.api",
- "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"]
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class ResourceControllerTest {
@Autowired
lateinit var resourceResolutionDBService: ResourceResolutionDBService
+
@Autowired
lateinit var webTestClient: WebTestClient
.consumeWith {
val r = JacksonUtils.objectMapper.readValue(it.responseBody, ErrorPayload::class.java)
Assert.assertEquals(
- "Cause: Missing param. Either retrieve resolved value using artifact name and " +
- "resolution-key OR using resource-id and resource-type. \n" +
- " Action : Please verify your request.",
+ "Cause: Missing param. Either retrieve resolved value using artifact name and " +
+ "resolution-key OR using resource-id and resource-type. \n" +
+ " Action : Please verify your request.",
r.message
)
}
val r = JacksonUtils.objectMapper.readValue(it.responseBody, ErrorPayload::class.java)
Assert.assertEquals(
"Cause: Either retrieve resolved value using artifact name and resolution-key OR using " +
- "resource-id and resource-type. \n Action : Please verify your request.",
+ "resource-id and resource-type. \n Action : Please verify your request.",
r.message
)
}
@RunWith(SpringRunner::class)
@WebFluxTest
@ContextConfiguration(
- classes = [TestDatabaseConfiguration::class, BluePrintCoreConfiguration::class,
- BluePrintCatalogService::class, ErrorCatalogTestConfiguration::class]
+ classes = [
+ TestDatabaseConfiguration::class, BluePrintCoreConfiguration::class,
+ BluePrintCatalogService::class, ErrorCatalogTestConfiguration::class
+ ]
)
@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
@TestPropertySource(locations = ["classpath:application-test.properties"])
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
- "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"],
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>inbounds</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-inbounds</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>selfservice-api</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Selfservice API</name>
- <description>Blueprints Processor Selfservice API</description>
+ <name>MS Blueprints Processor Modules - Inbound - Self Service API</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-validation</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-validation</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
<!-- For Message libraries -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>message-lib</artifactId>
</dependency>
fun onError(error: Exception) {
responseObserver.onError(
- Status.INTERNAL
- .withDescription(error.errorMessageOrDefault())
- .withCause(error.errorCauseOrDefault())
- .asException()
+ Status.INTERNAL
+ .withDescription(error.errorMessageOrDefault())
+ .withCause(error.errorCauseOrDefault())
+ .asException()
)
}
val errorPayload = errorCatalogService.errorPayload(error)
val grpcCode = Status.fromCodeValue(errorPayload.code)
responseObserver.onError(
- grpcCode
- .withDescription(errorPayload.message)
- .withCause(error.errorCauseOrDefault())
- .asException()
+ grpcCode
+ .withDescription(errorPayload.message)
+ .withCause(error.errorCauseOrDefault())
+ .asException()
)
}
private lateinit var blueprintMessageConsumerService: BlueprintMessageConsumerService
companion object {
+
const val CONSUMER_SELECTOR = "self-service-api"
const val PRODUCER_SELECTOR = "self-service-api"
}
try {
log.info(
"Setting up message consumer($CONSUMER_SELECTOR)" +
- "message producer($PRODUCER_SELECTOR)..."
+ "message producer($PRODUCER_SELECTOR)..."
)
/** Get the Message Consumer Service **/
.blueprintMessageConsumerService(CONSUMER_SELECTOR)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed creating Kafka consumer message service."
- throw e.updateErrorMessage(SelfServiceApiDomains.SELF_SERVICE_API, errorMsg,
- "Wrong Kafka selector provided or internal error in Kafka service.")
+ throw e.updateErrorMessage(
+ SelfServiceApiDomains.SELF_SERVICE_API, errorMsg,
+ "Wrong Kafka selector provided or internal error in Kafka service."
+ )
} catch (e: Exception) {
throw BluePrintProcessorException("failed to create consumer service ${e.message}")
}
/** Get the Message Producer Service **/
val blueprintMessageProducerService = try {
bluePrintMessageLibPropertyService
- .blueprintMessageProducerService(PRODUCER_SELECTOR)
+ .blueprintMessageProducerService(PRODUCER_SELECTOR)
} catch (e: BluePrintProcessorException) {
val errorMsg = "Failed creating Kafka producer message service."
- throw e.updateErrorMessage(SelfServiceApiDomains.SELF_SERVICE_API, errorMsg,
- "Wrong Kafka selector provided or internal error in Kafka service.")
+ throw e.updateErrorMessage(
+ SelfServiceApiDomains.SELF_SERVICE_API, errorMsg,
+ "Wrong Kafka selector provided or internal error in Kafka service."
+ )
} catch (e: Exception) {
throw BluePrintProcessorException("failed to create producer service ${e.message}")
}
} catch (e: Exception) {
log.error(
"failed to start message consumer($CONSUMER_SELECTOR) " +
- "message producer($PRODUCER_SELECTOR) ", e
+ "message producer($PRODUCER_SELECTOR) ",
+ e
)
}
}
try {
log.info(
"Shutting down message consumer($CONSUMER_SELECTOR)" +
- "message producer($PRODUCER_SELECTOR)..."
+ "message producer($PRODUCER_SELECTOR)..."
)
blueprintMessageConsumerService.shutDown()
ph.arriveAndAwaitAdvance()
package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api
object SelfServiceApiDomains {
+
// SelfServiceApi Domains Constants
const val BLUEPRINT_PROCESSOR = "org.onap.ccsdk.cds.blueprintsprocessor"
const val SELF_SERVICE_API = "org.onap.ccsdk.cds.blueprintsprocessor.resource.api"
): ResponseEntity<ExecutionServiceOutput> = mdcWebCoroutineScope {
if (executionServiceInput.actionIdentifiers.mode == ACTION_MODE_ASYNC) {
- throw httpProcessorException(ErrorCatalogCodes.GENERIC_FAILURE,
- SelfServiceApiDomains.BLUEPRINT_PROCESSOR,
- "Can't process async request through the REST endpoint. Use gRPC for async processing.")
+ throw httpProcessorException(
+ ErrorCatalogCodes.GENERIC_FAILURE,
+ SelfServiceApiDomains.BLUEPRINT_PROCESSOR,
+ "Can't process async request through the REST endpoint. Use gRPC for async processing."
+ )
}
ph.register()
val processResult = executionServiceHandler.doProcess(executionServiceInput)
*/
@RestControllerAdvice("org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api")
class ExecutionServiceExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
- ErrorCatalogExceptionHandler(errorCatalogService)
+ ErrorCatalogExceptionHandler(errorCatalogService)
private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val blueprintsProcessorCatalogService: BluePrintCatalogService,
private val bluePrintWorkflowExecutionService:
- BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>,
+ BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>,
private val publishAuditService: PublishAuditService
) {
else -> {
publishAuditService.publishExecutionInput(executionServiceInput)
val executionServiceOutput = response(
- executionServiceInput,
- "Failed to process request, 'actionIdentifiers.mode' not specified. Valid value are: 'sync' or 'async'.",
- true
+ executionServiceInput,
+ "Failed to process request, 'actionIdentifiers.mode' not specified. Valid value are: 'sync' or 'async'.",
+ true
)
publishAuditService.publishExecutionOutput(executionServiceInput.correlationUUID, executionServiceOutput)
responseObserver.onNext(
- executionServiceOutput.toProto()
+ executionServiceOutput.toProto()
)
}
}
* @property log Audit Service logger
*/
@ConditionalOnProperty(
- name = ["blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable"],
- havingValue = "true"
+ name = ["blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable"],
+ havingValue = "true"
)
@Service
class KafkaPublishAuditService(
private val bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService,
private val blueprintsProcessorCatalogService: BluePrintCatalogService
) : PublishAuditService {
+
private var inputInstance: BlueprintMessageProducerService? = null
private var outputInstance: BlueprintMessageProducerService? = null
private val log = LoggerFactory.getLogger(KafkaPublishAuditService::class.toString())
companion object {
+
const val INPUT_SELECTOR = "self-service-api.audit.request"
const val OUTPUT_SELECTOR = "self-service-api.audit.response"
}
this.inputInstance!!.sendMessage(key, secureExecutionServiceInput)
} catch (e: Exception) {
var errMsg =
- if (e.message != null) "ERROR : ${e.message}"
- else "ERROR : Failed to send execution request to Kafka."
+ if (e.message != null) "ERROR : ${e.message}"
+ else "ERROR : Failed to send execution request to Kafka."
log.error(errMsg)
}
}
this.outputInstance!!.sendMessage(key, executionServiceOutput)
} catch (e: Exception) {
var errMsg =
- if (e.message != null) "ERROR : $e"
- else "ERROR : Failed to send execution request to Kafka."
+ if (e.message != null) "ERROR : $e"
+ else "ERROR : Failed to send execution request to Kafka."
log.error(errMsg)
}
}
try {
if (clonedExecutionServiceInput.payload
- .path("$workflowName-request").has("$workflowName-properties")) {
+ .path("$workflowName-request").has("$workflowName-properties")
+ ) {
/** Retrieving sensitive input parameters */
val requestId = clonedExecutionServiceInput.commonHeader.requestId
/** We need to check in his Node Template Dependencies is case of a Node Template DG */
if (nodeTemplate.type == BluePrintConstants.NODE_TEMPLATE_TYPE_DG) {
- val dependencyNodeTemplate = nodeTemplate.properties?.get(BluePrintConstants.PROPERTY_DG_DEPENDENCY_NODE_TEMPLATE) as ArrayNode
+ val dependencyNodeTemplate =
+ nodeTemplate.properties?.get(BluePrintConstants.PROPERTY_DG_DEPENDENCY_NODE_TEMPLATE) as ArrayNode
dependencyNodeTemplate.forEach { dependencyNodeTemplateName ->
clonedExecutionServiceInput = hideSensitiveDataFromResourceResolution(
- blueprintRuntimeService,
- blueprintContext,
- clonedExecutionServiceInput,
- workflowName,
- dependencyNodeTemplateName.asText()
- )
- }
- } else {
- clonedExecutionServiceInput = hideSensitiveDataFromResourceResolution(
blueprintRuntimeService,
blueprintContext,
clonedExecutionServiceInput,
workflowName,
- nodeTemplateName
+ dependencyNodeTemplateName.asText()
+ )
+ }
+ } else {
+ clonedExecutionServiceInput = hideSensitiveDataFromResourceResolution(
+ blueprintRuntimeService,
+ blueprintContext,
+ clonedExecutionServiceInput,
+ workflowName,
+ nodeTemplateName
)
}
}
val errMsg = "ERROR : Couldn't hide sensitive data in the execution request."
log.error(errMsg, e)
clonedExecutionServiceInput.payload.replace(
- "$workflowName-request",
- "$errMsg $e".asJsonPrimitive())
+ "$workflowName-request",
+ "$errMsg $e".asJsonPrimitive()
+ )
}
return clonedExecutionServiceInput
}
val operationName = blueprintContext.nodeTemplateFirstInterfaceFirstOperationName(nodeTemplateName)
val propertyAssignments: MutableMap<String, JsonNode> =
- blueprintContext.nodeTemplateInterfaceOperationInputs(nodeTemplateName, interfaceName, operationName)
- ?: hashMapOf()
+ blueprintContext.nodeTemplateInterfaceOperationInputs(nodeTemplateName, interfaceName, operationName)
+ ?: hashMapOf()
/** Getting values define in artifact-prefix-names */
val input = executionServiceInput.payload.get("$workflowName-request")
val artifactPrefixNamesNode = propertyAssignments[ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES]
val propertyAssignmentService = PropertyAssignmentService(blueprintRuntimeService)
val artifactPrefixNamesNodeValue = propertyAssignmentService.resolveAssignmentExpression(
- BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
- nodeTemplateName,
- ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES,
- artifactPrefixNamesNode!!)
+ BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
+ nodeTemplateName,
+ ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES,
+ artifactPrefixNamesNode!!
+ )
val artifactPrefixNames = JacksonUtils.getListFromJsonNode(artifactPrefixNamesNodeValue!!, String::class.java)
/** Storing mapping entries with metadata log-protect set to true */
val sensitiveParameters: List<String> = artifactPrefixNames
- .map { "$it-mapping" }
- .map { blueprintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, it) }
- .flatMap { JacksonUtils.getListFromJson(it, ResourceAssignment::class.java) }
- .filter { PropertyDefinitionUtils.hasLogProtect(it.property) }
- .map { it.name }
+ .map { "$it-mapping" }
+ .map { blueprintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, it) }
+ .flatMap { JacksonUtils.getListFromJson(it, ResourceAssignment::class.java) }
+ .filter { PropertyDefinitionUtils.hasLogProtect(it.property) }
+ .map { it.name }
/** Hiding sensitive input parameters from the request */
var workflowProperties: ObjectNode = executionServiceInput.payload
- .path("$workflowName-request")
- .path("$workflowName-properties") as ObjectNode
+ .path("$workflowName-request")
+ .path("$workflowName-properties") as ObjectNode
sensitiveParameters.forEach { sensitiveParameter ->
if (workflowProperties.has(sensitiveParameter)) {
* Default audit service when no audit publisher is defined, message aren't sent
*/
@ConditionalOnProperty(
- name = ["blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable"],
- havingValue = "false"
+ name = ["blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable"],
+ havingValue = "false"
)
@Service
class NoPublishAuditService : PublishAuditService {
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
interface PublishAuditService {
+
suspend fun publishExecutionInput(executionServiceInput: ExecutionServiceInput)
suspend fun publishExecutionOutput(correlationUUID: String, executionServiceOutput: ExecutionServiceOutput)
}
@RunWith(SpringRunner::class)
@DirtiesContext
@ContextConfiguration(
- classes = [SelfServiceApiTestConfiguration::class, TestDatabaseConfiguration::class,
- ErrorCatalogTestConfiguration::class]
+ classes = [
+ SelfServiceApiTestConfiguration::class, TestDatabaseConfiguration::class,
+ ErrorCatalogTestConfiguration::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class BluePrintProcessingGRPCHandlerTest {
import org.springframework.test.context.ContextConfiguration
@ContextConfiguration(
- classes = [SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class]
+ classes = [SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class]
)
class BluePrintProcessingIntegrationTest {
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintMessageLibConfiguration::class, SelfServiceApiTestConfiguration::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, ErrorCatalogTestConfiguration::class]
+ classes = [
+ BluePrintMessageLibConfiguration::class, SelfServiceApiTestConfiguration::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, ErrorCatalogTestConfiguration::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class BluePrintProcessingKafkaConsumerTest {
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
@RunWith(SpringRunner::class)
@WebFluxTest
@ContextConfiguration(
- classes = [ExecutionServiceHandler::class, BluePrintCoreConfiguration::class,
- BluePrintCatalogService::class, SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class]
+ classes = [
+ ExecutionServiceHandler::class, BluePrintCoreConfiguration::class,
+ BluePrintCatalogService::class, SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class
+ ]
)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class ExecutionServiceControllerTest {
@Autowired
lateinit var blueprintsProcessorCatalogService: BluePrintCatalogService
+
@Autowired
lateinit var webTestClient: WebTestClient
package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api
-import io.mockk.coVerify
import io.mockk.Runs
import io.mockk.coEvery
+import io.mockk.coVerify
import io.mockk.just
import io.mockk.mockk
import kotlinx.coroutines.runBlocking
import kotlin.test.assertTrue
@RunWith(SpringRunner::class)
-@ContextConfiguration(classes = [MockServiceAction::class, SelfServiceApiTestConfiguration::class,
- ErrorCatalogTestConfiguration::class])
+@ContextConfiguration(
+ classes = [
+ MockServiceAction::class, SelfServiceApiTestConfiguration::class,
+ ErrorCatalogTestConfiguration::class
+ ]
+)
@TestPropertySource(locations = ["classpath:application-test.properties"])
class ExecutionServiceHandlerTest {
val publishAuditService = mockk<KafkaPublishAuditService>(relaxed = true)
val executionServiceHandler = ExecutionServiceHandler(
- mockk(),
- mockk(),
- mockk(),
- publishAuditService
+ mockk(),
+ mockk(),
+ mockk(),
+ publishAuditService
)
coEvery { publishAuditService.publishExecutionInput(ExecutionServiceInput()) } just Runs
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.cds.controllerblueprints",
- "org.onap.ccsdk.cds.blueprintsprocessor"]
+ basePackages = [
+ "org.onap.ccsdk.cds.controllerblueprints",
+ "org.onap.ccsdk.cds.blueprintsprocessor"
+ ]
)
@EnableAutoConfiguration
open class SelfServiceApiTestConfiguration
@Configuration
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
- basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
- "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"],
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution"
+ ],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
}
open class MockResourceSource {
+
@Bean(
name = [
"rr-processor-source-input",
"rr-processor-source-default",
"rr-processor-source-db",
- "rr-processor-source-rest"]
+ "rr-processor-source-rest"
+ ]
)
open fun sourceInstance(): ResourceAssignmentProcessor {
return mockk<ResourceAssignmentProcessor>()
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [BluePrintRuntimeValidatorService::class,
- BluePrintValidationConfiguration::class, MockResourceSource::class]
+ classes = [
+ BluePrintRuntimeValidatorService::class,
+ BluePrintValidationConfiguration::class, MockResourceSource::class
+ ]
)
class BluePrintRuntimeValidatorServiceTest {
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>modules</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-modules</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <artifactId>outbounds</artifactId>
+ <artifactId>modules-outbounds</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Outbounds POM</name>
- <description>Blueprints Processor Outbounds</description>
+ <name>MS Blueprints Processor Modules - Outbounds</name>
</project>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
- <artifactId>modules</artifactId>
+ <artifactId>blueprintsprocessor-modules</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Modules</name>
- <description>Blueprints Processor Modules</description>
+ <name>MS Blueprints Processor Modules (Root)</name>
<modules>
<module>blueprints</module>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
</goals>
</execution>
</executions>
- <configuration>
- <jvmTarget>1.8</jvmTarget>
- </configuration>
</plugin>
</plugins>
</build>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>services</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-services</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>execution-service</artifactId>
<packaging>jar</packaging>
- <name>Blueprints Processor Execution Service</name>
- <description>Blueprints Processor Execution Service</description>
+ <name>MS Blueprints Processor Modules - Services - Execution Service</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>db-lib</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>rest-lib</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>grpc-lib</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>nats-lib</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>resource-dict</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>resource-dict</artifactId>
</dependency>
-
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-provider</artifactId>
</dependency>
-
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
/** Resolve and validate lock properties */
implementation.lock?.apply {
val resolvedValues = bluePrintRuntimeService.resolvePropertyAssignments(
- BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
- interfaceName,
- mutableMapOf("key" to this.key, "acquireTimeout" to this.acquireTimeout))
+ BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
+ interfaceName,
+ mutableMapOf("key" to this.key, "acquireTimeout" to this.acquireTimeout)
+ )
this.key = resolvedValues["key"] ?: "".asJsonType()
this.acquireTimeout = resolvedValues["acquireTimeout"] ?: "".asJsonType()
prepareRequestNB(executionServiceInput)
implementation.lock?.let {
bluePrintClusterService.clusterLock("${it.key.textValue()}@$CDS_LOCK_GROUP")
- .executeWithLock(it.acquireTimeout.intValue().times(1000).toLong()) {
- applyNBWithTimeout(executionServiceInput)
- }
+ .executeWithLock(it.acquireTimeout.intValue().times(1000).toLong()) {
+ applyNBWithTimeout(executionServiceInput)
+ }
} ?: applyNBWithTimeout(executionServiceInput)
} catch (runtimeException: RuntimeException) {
log.error("failed in ${getName()} : ${runtimeException.message}", runtimeException)
}
private suspend fun applyNBWithTimeout(executionServiceInput: ExecutionServiceInput) =
- withTimeout((implementation.timeout * 1000).toLong()) {
- log.debug("DEBUG::: AbstractComponentFunction.withTimeout " +
- "section ${implementation.timeout} seconds")
- processNB(executionServiceInput)
- }
+ withTimeout((implementation.timeout * 1000).toLong()) {
+ log.debug(
+ "DEBUG::: AbstractComponentFunction.withTimeout " +
+ "section ${implementation.timeout} seconds"
+ )
+ processNB(executionServiceInput)
+ }
fun getOperationInput(key: String): JsonNode {
return operationInputs[key]
import org.slf4j.LoggerFactory
abstract class AbstractScriptComponentFunction : AbstractComponentFunction() {
+
private val log = LoggerFactory.getLogger(AbstractScriptComponentFunction::class.java)!!
companion object {
+
const val DYNAMIC_PROPERTIES = "dynamic-properties"
}
log.info(
"creating component function of script type($scriptType), reference name($scriptClassReference) and " +
- "instanceDependencies($instanceDependencies)"
+ "instanceDependencies($instanceDependencies)"
)
val scriptComponent: T = scriptInstance(
) : AbstractComponentFunction() {
companion object {
+
const val INPUT_SELECTOR = "selector"
const val INPUT_BLUEPRINT_NAME = "blueprint-name"
const val INPUT_BLUEPRINT_VERSION = "blueprint-version"
AbstractComponentFunction() {
companion object {
+
const val INPUT_SCRIPT_TYPE = "script-type"
const val INPUT_SCRIPT_CLASS_REFERENCE = "script-class-reference"
const val INPUT_DYNAMIC_PROPERTIES = "dynamic-properties"
package org.onap.ccsdk.cds.blueprintsprocessor.services.execution
object ExecutionServiceDomains {
+
// ExecutionService Domains Constants
const val BLUEPRINT_PROCESSOR = "org.onap.ccsdk.cds.blueprintsprocessor"
const val NETCONF_EXECUTOR = "org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor"
open class ExecutionServiceConfiguration
object ExecutionServiceConstant {
+
const val SERVICE_GRPC_REMOTE_SCRIPT_EXECUTION = "grpc-remote-script-execution-service"
}
import java.util.concurrent.TimeUnit
interface RemoteScriptExecutionService {
+
suspend fun init(selector: Any)
suspend fun prepareEnv(prepareEnvInput: PrepareRemoteEnvInput): RemoteScriptExecutionOutput
suspend fun executeCommand(remoteExecutionInput: RemoteScriptExecutionInput): RemoteScriptExecutionOutput
private val grpcChannels: MutableMap<String, ManagedChannel> = hashMapOf()
private val commChannels: MutableMap<String,
- ClientBidiCallChannel<ExecutionServiceInput, ExecutionServiceOutput>> = hashMapOf()
+ ClientBidiCallChannel<ExecutionServiceInput, ExecutionServiceOutput>> = hashMapOf()
/**
* Open new channel to send and receive for grpc properties [selector] for [txId],
*/
@ExperimentalCoroutinesApi
override suspend fun sendNonInteractive(selector: Any, txId: String, input: ExecutionServiceInput, timeOutMill: Long):
- ExecutionServiceOutput {
-
- var output: ExecutionServiceOutput? = null
- val flow = openSubscription(selector, txId)
-
- /** Send the request */
- val sendChannel = commChannels[txId]?.requestChannel
- ?: throw BluePrintException("failed to get transactionId($txId) send channel")
- sendChannel.send(input)
-
- /** Receive the response with timeout */
- withTimeout(timeOutMill) {
- flow.collect {
- log.trace("Received non-interactive transactionId($txId) response : ${it.status.eventType}")
- if (it.status.eventType == EventType.EVENT_COMPONENT_EXECUTED) {
- output = it
- cancelSubscription(txId)
+ ExecutionServiceOutput {
+
+ var output: ExecutionServiceOutput? = null
+ val flow = openSubscription(selector, txId)
+
+ /** Send the request */
+ val sendChannel = commChannels[txId]?.requestChannel
+ ?: throw BluePrintException("failed to get transactionId($txId) send channel")
+ sendChannel.send(input)
+
+ /** Receive the response with timeout */
+ withTimeout(timeOutMill) {
+ flow.collect {
+ log.trace("Received non-interactive transactionId($txId) response : ${it.status.eventType}")
+ if (it.status.eventType == EventType.EVENT_COMPONENT_EXECUTED) {
+ output = it
+ cancelSubscription(txId)
+ }
}
}
+ return output!!
}
- return output!!
- }
/** Cancel the Subscription for the [txId], This closes communication channel **/
@ExperimentalCoroutinesApi
override fun jythonComponentInstance(bluePrintContext: BluePrintContext, scriptClassReference: String):
BlueprintFunctionNode<*, *> {
- throw BluePrintProcessorException("Include python-executor module for Jython support")
- }
+ throw BluePrintProcessorException("Include python-executor module for Jython support")
+ }
}
val mockExecutionServiceInput = mockExecutionServiceInput(bluePrintRuntime)
val mockStreamingRemoteExecutionService = mockk<StreamingRemoteExecutionService<
- org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput,
- ExecutionServiceOutput>>()
+ org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput,
+ ExecutionServiceOutput>>()
coEvery {
mockStreamingRemoteExecutionService.sendNonInteractive(
override fun onNext(executionServiceInput: ExecutionServiceInput) {
log.info(
"Received requestId(${executionServiceInput.commonHeader.requestId}) " +
- "subRequestId(${executionServiceInput.commonHeader.subRequestId})"
+ "subRequestId(${executionServiceInput.commonHeader.subRequestId})"
)
runBlocking {
launch(MDCContext()) {
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.junit4.SpringRunner
-import java.lang.RuntimeException
import kotlin.test.BeforeTest
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
*/
@RunWith(SpringRunner::class)
@ContextConfiguration(
- classes = [ComponentFunctionScriptingService::class,
- BluePrintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class]
+ classes = [
+ ComponentFunctionScriptingService::class,
+ BluePrintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class
+ ]
)
class AbstractComponentFunctionTest {
every {
bluePrintRuntimeService.resolvePropertyAssignments(any(), any(), any())
} returns mutableMapOf(
- "key" to "abc-123-def-456".asJsonType(),
- "acquireTimeout" to implementation.lock!!.acquireTimeout
+ "key" to "abc-123-def-456".asJsonType(),
+ "acquireTimeout" to implementation.lock!!.acquireTimeout
)
val component: AbstractComponentFunction = SampleComponent()
every {
bluePrintRuntimeService.resolvePropertyAssignments(any(), any(), any())
- } returns mutableMapOf("key" to "".asJsonType(),
- "acquireTimeout" to Integer(360).asJsonType())
+ } returns mutableMapOf(
+ "key" to "".asJsonType(),
+ "acquireTimeout" to Integer(360).asJsonType()
+ )
val component: AbstractComponentFunction = SampleComponent()
component.bluePrintRuntimeService = bluePrintRuntimeService
every {
bluePrintRuntimeService.resolvePropertyAssignments(any(), any(), any())
- } returns mutableMapOf("key" to lockName.asJsonType(),
- "acquireTimeout" to Integer(180).asJsonType())
+ } returns mutableMapOf(
+ "key" to lockName.asJsonType(),
+ "acquireTimeout" to Integer(180).asJsonType()
+ )
val clusterLock: ClusterLock = mockk()
private fun getMockedInput(bluePrintRuntime: DefaultBluePrintRuntimeService):
ExecutionServiceInput {
- val mapper = ObjectMapper()
- val rootNode = mapper.createObjectNode()
- rootNode.put("ip-address", "0.0.0.0")
- rootNode.put("type", "rest")
-
- val operationInputs = hashMapOf<String, JsonNode>()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
- "activate-restconf".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
- "interfaceName".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] =
- "operationName".asJsonPrimitive()
- operationInputs["dynamic-properties"] = rootNode
-
- val stepInputData = StepData().apply {
- name = "activate-restconf"
- properties = operationInputs
- }
- val executionServiceInput = ExecutionServiceInput().apply {
- commonHeader = CommonHeader().apply {
- requestId = "1234"
+ val mapper = ObjectMapper()
+ val rootNode = mapper.createObjectNode()
+ rootNode.put("ip-address", "0.0.0.0")
+ rootNode.put("type", "rest")
+
+ val operationInputs = hashMapOf<String, JsonNode>()
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
+ "activate-restconf".asJsonPrimitive()
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
+ "interfaceName".asJsonPrimitive()
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] =
+ "operationName".asJsonPrimitive()
+ operationInputs["dynamic-properties"] = rootNode
+
+ val stepInputData = StepData().apply {
+ name = "activate-restconf"
+ properties = operationInputs
}
- actionIdentifiers = ActionIdentifiers().apply {
- actionName = "activate"
+ val executionServiceInput = ExecutionServiceInput().apply {
+ commonHeader = CommonHeader().apply {
+ requestId = "1234"
+ }
+ actionIdentifiers = ActionIdentifiers().apply {
+ actionName = "activate"
+ }
+ payload = JacksonUtils.jsonNode("{}") as ObjectNode
}
- payload = JacksonUtils.jsonNode("{}") as ObjectNode
+ executionServiceInput.stepData = stepInputData
+
+ every {
+ bluePrintRuntime.resolveNodeTemplateInterfaceOperationInputs(
+ "activate-restconf", "interfaceName", "operationName"
+ )
+ } returns operationInputs
+
+ val operationOutputs = hashMapOf<String, JsonNode>()
+ every {
+ bluePrintRuntime.resolveNodeTemplateInterfaceOperationOutputs(
+ "activate-restconf", "interfaceName", "operationName"
+ )
+ } returns operationOutputs
+ every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
+
+ return executionServiceInput
}
- executionServiceInput.stepData = stepInputData
-
- every {
- bluePrintRuntime.resolveNodeTemplateInterfaceOperationInputs(
- "activate-restconf", "interfaceName", "operationName"
- )
- } returns operationInputs
-
- val operationOutputs = hashMapOf<String, JsonNode>()
- every {
- bluePrintRuntime.resolveNodeTemplateInterfaceOperationOutputs(
- "activate-restconf", "interfaceName", "operationName"
- )
- } returns operationOutputs
- every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
-
- return executionServiceInput
- }
}
this,
"internal",
"org.onap.ccsdk.cds.blueprintsprocessor.services" +
- ".execution.scripts.SampleTest",
+ ".execution.scripts.SampleTest",
mutableListOf()
)
scriptComponent.executeScript(executionServiceInput)
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>modules</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-modules</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
- <artifactId>services</artifactId>
+ <artifactId>modules-services</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Service POM</name>
- <description>Blueprints Processor Service</description>
+ <name>MS Blueprints Processor Modules - Services</name>
<modules>
<module>execution-service</module>
<parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>services</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>modules-services</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>workflow-service</artifactId>
- <name>Blueprints Processor Workflow Service</name>
- <description>Blueprints Processor Workflow Service</description>
+ <name>MS Blueprints Processor Modules - Services - Workflow Service</name>
<dependencies>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>blueprint-core</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-core</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>execution-service</artifactId>
</dependency>
<dependency>
else -> {
throw BluePrintProcessorException(
"couldn't execute workflow($workflowName) step mapped " +
- "to node template($nodeTemplateName) derived from($derivedFrom)"
+ "to node template($nodeTemplateName) derived from($derivedFrom)"
)
}
}
// Set the Response Payload
executionServiceOutput.payload = JacksonUtils.objectMapper.createObjectNode()
executionServiceOutput.payload.set<JsonNode>(
- "$workflowName-response",
- workflowOutputs?.asObjectNode() ?: JacksonUtils.objectMapper.createObjectNode()
+ "$workflowName-response",
+ workflowOutputs?.asObjectNode() ?: JacksonUtils.objectMapper.createObjectNode()
)
return executionServiceOutput
}
val graph = bluePrintContext.workflowByName(workflowName).asGraph()
return ImperativeBluePrintWorkflowService(nodeTemplateExecutionService)
- .executeWorkflow(graph, bluePrintRuntimeService, executionServiceInput)
+ .executeWorkflow(graph, bluePrintRuntimeService, executionServiceInput)
}
}
}
override suspend fun prepareNodeExecutionMessage(node: Graph.Node):
- NodeExecuteMessage<ExecutionServiceInput, ExecutionServiceOutput> {
- val nodeOutput = ExecutionServiceOutput().apply {
- commonHeader = executionServiceInput.commonHeader
- actionIdentifiers = executionServiceInput.actionIdentifiers
+ NodeExecuteMessage<ExecutionServiceInput, ExecutionServiceOutput> {
+ val nodeOutput = ExecutionServiceOutput().apply {
+ commonHeader = executionServiceInput.commonHeader
+ actionIdentifiers = executionServiceInput.actionIdentifiers
+ }
+ return NodeExecuteMessage(node, executionServiceInput, nodeOutput)
}
- return NodeExecuteMessage(node, executionServiceInput, nodeOutput)
- }
override suspend fun prepareNodeSkipMessage(node: Graph.Node):
- NodeSkipMessage<ExecutionServiceInput, ExecutionServiceOutput> {
- val nodeOutput = ExecutionServiceOutput().apply {
- commonHeader = executionServiceInput.commonHeader
- actionIdentifiers = executionServiceInput.actionIdentifiers
+ NodeSkipMessage<ExecutionServiceInput, ExecutionServiceOutput> {
+ val nodeOutput = ExecutionServiceOutput().apply {
+ commonHeader = executionServiceInput.commonHeader
+ actionIdentifiers = executionServiceInput.actionIdentifiers
+ }
+ return NodeSkipMessage(node, executionServiceInput, nodeOutput)
}
- return NodeSkipMessage(node, executionServiceInput, nodeOutput)
- }
override suspend fun executeNode(
node: Graph.Node,
val step = bluePrintRuntimeService.bluePrintContext().workflowStepByName(this.workflowName, node.id)
checkNotEmpty(step.target) { "couldn't get step target for workflow(${this.workflowName})'s step(${node.id})" }
val nodeTemplateName = step.target!!
+
/** execute node template */
val executionServiceOutput = nodeTemplateExecutionService
.executeNodeTemplate(bluePrintRuntimeService, nodeTemplateName, nodeInput)
class WorkflowServiceConstants {
companion object {
+
const val ARTIFACT_TYPE_DIRECTED_GRAPH = "artifact-directed-graph"
}
}
@Throws(SvcLogicException::class)
override fun execute(svc: SvcLogicServiceBase, node: SvcLogicNode, svcLogicContext: SvcLogicContext):
- SvcLogicNode = runBlocking {
+ SvcLogicNode = runBlocking {
- var outValue: String
+ var outValue: String
- val ctx = svcLogicContext as BlueprintSvcLogicContext
+ val ctx = svcLogicContext as BlueprintSvcLogicContext
- val nodeTemplateName = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx)
+ val nodeTemplateName = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx)
- val executionInput = ctx.getRequest() as ExecutionServiceInput
+ val executionInput = ctx.getRequest() as ExecutionServiceInput
- try { // Get the Request from the Context and Set to the Function Input and Invoke the function
- val executionOutput = nodeTemplateExecutionService.executeNodeTemplate(
- ctx.getBluePrintService(),
- nodeTemplateName, executionInput
- )
+ try { // Get the Request from the Context and Set to the Function Input and Invoke the function
+ val executionOutput = nodeTemplateExecutionService.executeNodeTemplate(
+ ctx.getBluePrintService(),
+ nodeTemplateName, executionInput
+ )
- ctx.setResponse(executionOutput)
+ ctx.setResponse(executionOutput)
- outValue = executionOutput.status.message
- ctx.status = executionOutput.status.message
- } catch (e: Exception) {
- log.error("Could not execute plugin($nodeTemplateName) : ", e)
- outValue = "failure"
- ctx.status = "failure"
- }
+ outValue = executionOutput.status.message
+ ctx.status = executionOutput.status.message
+ } catch (e: Exception) {
+ log.error("Could not execute plugin($nodeTemplateName) : ", e)
+ outValue = "failure"
+ ctx.status = "failure"
+ }
- getNextNode(node, outValue)
- }
+ getNextNode(node, outValue)
+ }
}
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.junit4.SpringRunner
-import java.lang.RuntimeException
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
fun `Should handle errors from resolve workflow output`() {
val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService = mockk()
val bluePrintWorkflowExecutionServiceImpl = BluePrintWorkflowExecutionServiceImpl(
- mockk(), mockk(), imperativeWorkflowExecutionService)
+ mockk(), mockk(), imperativeWorkflowExecutionService
+ )
val bluePrintRuntimeService: BluePrintRuntimeService<MutableMap<String, JsonNode>> = mockk()
val bluePrintContext: BluePrintContext = mockk()
val executionServiceInput = ExecutionServiceInput().apply {
runBlocking {
val output = bluePrintWorkflowExecutionServiceImpl.executeBluePrintWorkflow(
- bluePrintRuntimeService, executionServiceInput, mutableMapOf())
+ bluePrintRuntimeService, executionServiceInput, mutableMapOf()
+ )
assertEquals("failed to resolve property...", blueprintError.errors[0])
assertEquals("""{"config-assign-response":{}}""".asJsonType(), output.payload)
}
import kotlin.test.assertNotNull
class ImperativeWorkflowExecutionServiceTest {
+
val log = logger(ImperativeWorkflowExecutionServiceTest::class)
@Before
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
<artifactId>blueprintsprocessor</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>blueprintsprocessor-parent</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Parent</name>
- <description>Blueprints Processor Parent</description>
+ <name>MS Blueprints Processor Parent</name>
<properties>
- <sli.version>${ccsdk.sli.core.version}</sli.version>
<!-- Override CDS version from parent to be project.version -->
- <ccsdk.cds.version>${project.version}</ccsdk.cds.version>
<error.catalog.version>${project.version}</error.catalog.version>
<dmaap.client.version>1.1.5</dmaap.client.version>
<!-- Should be using released artifact as soon as available: -->
<!-- https://github.com/springfox/springfox/milestone/44 -->
- <springfox.swagger2.version>2.9.2</springfox.swagger2.version>
+ <springfox.swagger2.version>2.10.5</springfox.swagger2.version>
<eelf.version>1.0.0</eelf.version>
<onap.logger.slf4j>1.2.2</onap.logger.slf4j>
<hazelcast.version>4.0</hazelcast.version>
<type>pom</type>
<scope>import</scope>
</dependency>
-
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-jdk8</artifactId>
- <version>${kotlin.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-jdk7</artifactId>
- <version>${kotlin.version}</version>
- </dependency>
-
<dependency>
<groupId>com.github.marcoferrer.krotoplus</groupId>
<artifactId>kroto-plus-coroutines</artifactId>
<artifactId>jsch</artifactId>
<version>${jsch.version}</version>
</dependency>
-
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-provider</artifactId>
- <version>${sli.version}</version>
+ <version>${ccsdk.sli.core.version}</version>
<exclusions>
<exclusion>
<groupId>commons-lang</groupId>
<!-- Blueprint Processor Application Module Dependencies -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>processor-core</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>db-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>rest-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>nats-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>ssh-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<!-- message-lib dependency -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>message-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>dmaap-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>grpc-lib</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>execution-service</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>workflow-service</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<!-- North Bound -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>configs-api</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>designer-api</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>resource-api</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>selfservice-api</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>application</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprintsprocessor-application</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api-common</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<!-- Controller Blueprints Application Dependency -->
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>resource-dict</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-core</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-validation</artifactId>
<version>${ccsdk.cds.version}</version>
</dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-script-util</artifactId>
</dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-jdk8</artifactId>
- </dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>
-
+ <!-- javax.annotations Needed for Java 11 migration-->
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <version>${javax-annotation.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
<artifactId>error-catalog-core</artifactId>
</dependency>
+ <!-- required for java 11 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-validation</artifactId>
+ </dependency>
</dependencies>
<repositories>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.5.1</version>
- <configuration>
- <source>${maven.compiler.source}</source>
- <target>${maven.compiler.target}</target>
- </configuration>
- </plugin>
</plugins>
</build>
</project>
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>blueprintsprocessor</artifactId>
<packaging>pom</packaging>
- <name>Blueprints Processor Root</name>
- <description>Blueprints Processor Root</description>
+ <name>MS Blueprints Processor (Root)</name>
<modules>
<module>parent</module>
- <module>cba-parent</module>
<module>modules</module>
<module>functions</module>
<module>application</module>
<properties>
<service.name>BlueprintsProcessor</service.name>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <build.number>${maven.build.timestamp}</build.number>
- <java.version>1.8</java.version>
- <maven.compiler.target>1.8</maven.compiler.target>
- <maven.compiler.source>1.8</maven.compiler.source>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
</properties>
</project>
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>command-executor</artifactId>
<packaging>pom</packaging>
- <name>Command Executor</name>
+ <name>MS Command Executor</name>
<description>Micro-service providing python environment with gRPC binding for command execution</description>
<properties>
<assembly.id>maven</assembly.id>
<image.name>onap/ccsdk-commandexecutor</image.name>
- <docker.push.phase>deploy</docker.push.phase>
- <docker.verbose>true</docker.verbose>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
</properties>
<build>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.26.1</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
- <verbose>true</verbose>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
+ <id>build-push-images</id>
<phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
-FROM python:3.6-slim
-
-ENV GRPC_PYTHON_VERSION 1.20.0
-RUN python -m pip install --upgrade pip
-RUN pip install grpcio==${GRPC_PYTHON_VERSION} grpcio-tools==${GRPC_PYTHON_VERSION}
-RUN pip install virtualenv==16.7.9
-
-RUN groupadd -r -g 1000 onap && useradd -r -u 1000 -g onap onap
-
-COPY start.sh /opt/app/onap/start.sh
-RUN chmod u+x /opt/app/onap/start.sh
+FROM python:3.7-slim
+USER root
RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log
+# add entrypoint
+COPY start.sh /opt/app/onap/command-executor/start.sh
+# add application
COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
+
RUN tar -xzf /source.tar.gz -C /tmp \
&& cp -rf /tmp/@project.build.finalName@/opt / \
&& rm -rf /source.tar.gz \
- && rm -rf /tmp/@project.build.finalName@
-
-RUN mkdir -p /opt/app/onap/blueprints/deploy
-RUN chown onap:onap /opt -R
+ && rm -rf /tmp/@project.build.finalName@ \
+ && mkdir -p /opt/app/onap/blueprints/deploy \
+ && chmod 755 /opt/app/onap/command-executor/start.sh
VOLUME /opt/app/onap/blueprints/deploy/
+
+RUN python -m pip install --upgrade pip setuptools
+RUN pip install grpcio==1.20.0 grpcio-tools==1.20.0
+RUN pip install virtualenv==16.7.9
+
+RUN groupadd -r -g 1000 onap && useradd -r -u 1000 -g onap onap
+RUN chown onap:onap /opt -R
USER onap
-ENTRYPOINT /opt/app/onap/start.sh
+ENTRYPOINT /opt/app/onap/command-executor/start.sh
<parent>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
<artifactId>error-catalog</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>error-catalog-application</artifactId>
- <name>Error Catalog Application</name>
+ <name>MS Error Catalog Application</name>
<description>Error Catalog Application</description>
<properties>
<parent>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
<artifactId>error-catalog</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>error-catalog-core</artifactId>
- <name>Error Catalog Core</name>
+ <name>MS Error Catalog Core</name>
<description>Error Catalog Core</description>
<properties>
package org.onap.ccsdk.cds.error.catalog.core
interface ErrorCatalogExceptionFluent<T> {
+
fun code(code: Int): T
fun domain(domain: String): T
fun action(action: String): T
}
open class ErrorCatalogException : RuntimeException {
+
var code: Int = -1
var domain: String = ""
var name: String = ErrorCatalogCodes.GENERIC_FAILURE
constructor(code: Int, cause: Throwable, message: String, vararg args: Any?) :
super(String.format(message, *args), cause) {
- this.code = code
- }
+ this.code = code
+ }
open fun <T : ErrorCatalogException> updateCode(code: Int): T {
this.code = code
package org.onap.ccsdk.cds.error.catalog.core
object ErrorCatalogCodes {
+
const val GENERIC_FAILURE = "GENERIC_FAILURE"
const val GENERIC_PROCESS_FAILURE = "GENERIC_PROCESS_FAILURE"
const val INVALID_FILE_EXTENSION = "INVALID_FILE_EXTENSION"
}
object HttpErrorCodes {
+
private val store: MutableMap<String, Int> = mutableMapOf()
init {
}
object GrpcErrorCodes {
+
private val store: MutableMap<String, Int> = mutableMapOf()
init {
package org.onap.ccsdk.cds.error.catalog.core
import com.fasterxml.jackson.annotation.JsonFormat
-import org.slf4j.event.Level
import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants.ERROR_CATALOG_DEFAULT_ERROR_CODE
+import org.slf4j.event.Level
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.Date
-import kotlin.collections.ArrayList
open class ErrorPayload {
+
var code: Int = ERROR_CATALOG_DEFAULT_ERROR_CODE
var status: String = ""
+
@get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
var timestamp: Date = controllerDate()
var message: String = ""
}
fun isEqualTo(errorPayload: ErrorPayload): Boolean {
- return (this.code == errorPayload.code && this.status == errorPayload.status && this.message == errorPayload.message &&
- this.logLevel == errorPayload.logLevel && this.debugMessage == errorPayload.debugMessage &&
- this.subErrors == errorPayload.subErrors)
+ return (
+ this.code == errorPayload.code && this.status == errorPayload.status && this.message == errorPayload.message &&
+ this.logLevel == errorPayload.logLevel && this.debugMessage == errorPayload.debugMessage &&
+ this.subErrors == errorPayload.subErrors
+ )
}
private fun controllerDate(): Date {
val action: String,
val cause: String
) {
+
fun getMessage(): String {
return "Cause: $cause ${System.lineSeparator()} Action : $action"
}
package org.onap.ccsdk.cds.error.catalog.core
object ErrorMessageLibConstants {
+
const val ERROR_CATALOG_DOMAIN = "org.onap.ccsdk.cds.error.catalog"
const val ERROR_CATALOG_TYPE = "error.catalog.type"
const val ERROR_CATALOG_TYPE_PROPERTIES = "properties"
import org.apache.commons.lang3.exception.ExceptionUtils
object ErrorCatalogUtils {
+
private const val REGEX_PATTERN = "^cause=(.*),action=(.*)"
private val regex = REGEX_PATTERN.toRegex()
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>error-catalog</artifactId>
<packaging>pom</packaging>
- <name>Error Catalog Lib</name>
+ <name>MS Error Catalog Lib</name>
<description>Error Catalog Lib for ONAP Components</description>
<modules>
<!-- Kotlin Dependencies -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-jdk8</artifactId>
+ <artifactId>kotlin-stdlib</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib</artifactId>
- </dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
- <version>${kotlin.maven.version}</version>
<executions>
<execution>
<id>compile</id>
<parent>
<groupId>org.onap.ccsdk.cds.error.catalog</groupId>
<artifactId>error-catalog</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>error-catalog-services</artifactId>
- <name>Error Catalog Service</name>
+ <name>MS Error Catalog Service</name>
<description>Error Catalog Service</description>
<properties>
@Component
@ConfigurationProperties(prefix = "error.catalog")
open class ErrorCatalogProperties {
+
lateinit var type: String
lateinit var applicationId: String
var errorDefinitionDir: String? = null
* This is a getAllDomains method to retrieve all the Domain in Error Catalog Database by pages
*
* @return Page<Domain> list of the domains by page
- </Domain> */
+ </Domain> */
open fun getAllDomains(pageRequest: Pageable): Page<Domain> {
return domainRepository.findAll(pageRequest)
}
* This is a getAllDomains method to retrieve all the Domain in Error Catalog Database
*
* @return List<Domain> list of the domains
- </Domain> */
+ </Domain> */
open fun getAllDomains(): List<Domain> {
return domainRepository.findAll()
}
* This is a getAllDomainsByApplication method to retrieve all the Domain that belong to an application in Error Catalog Database
*
* @return List<Domain> list of the domains
- </Domain> */
+ </Domain> */
open fun getAllDomainsByApplication(applicationId: String): List<Domain> {
return domainRepository.findAllByApplicationId(applicationId)
}
* This is a getAllErrorMessagesByApplication method to retrieve all the Messages that belong to an application in Error Catalog Database
*
* @return MutableMap<String, ErrorCode> list of the abstractErrorModel
- </Domain> */
+ </Domain> */
open fun getAllErrorMessagesByApplication(applicationId: String): MutableMap<String, ErrorMessageModel> {
val domains = domainRepository.findAllByApplicationId(applicationId)
val errorMessages = mutableMapOf<String, ErrorMessageModel>()
}
companion object {
+
private const val MESSAGE_KEY_SEPARATOR = "."
}
}
@ExceptionHandler
fun errorCatalogException(e: ServerWebInputException): ResponseEntity<ErrorPayload> {
- val error = ErrorCatalogException(HttpErrorCodes.code(ErrorCatalogCodes.REQUEST_NOT_FOUND),
- e.errorMessageOrDefault(), e.errorCauseOrDefault())
+ val error = ErrorCatalogException(
+ HttpErrorCodes.code(ErrorCatalogCodes.REQUEST_NOT_FOUND),
+ e.errorMessageOrDefault(), e.errorCauseOrDefault()
+ )
val errorPayload = ErrorPayload(error.code, error.name, error.errorMessageOrDefault())
return errorPayload.toResponseEntity()
}
@ExceptionHandler
fun errorCatalogException(e: IncorrectResultSizeDataAccessException): ResponseEntity<ErrorPayload> {
- val error = ErrorCatalogException(HttpErrorCodes.code(ErrorCatalogCodes.DUPLICATE_DATA),
- e.errorMessageOrDefault(), e.errorCauseOrDefault())
+ val error = ErrorCatalogException(
+ HttpErrorCodes.code(ErrorCatalogCodes.DUPLICATE_DATA),
+ e.errorMessageOrDefault(), e.errorCauseOrDefault()
+ )
val errorPayload = ErrorPayload(error.code, error.name, error.errorMessageOrDefault())
return errorPayload.toResponseEntity()
}
@ExceptionHandler
fun errorCatalogException(e: EmptyResultDataAccessException): ResponseEntity<ErrorPayload> {
- val error = ErrorCatalogException(HttpErrorCodes.code(ErrorCatalogCodes.RESOURCE_NOT_FOUND),
- e.errorMessageOrDefault(), e.errorCauseOrDefault())
+ val error = ErrorCatalogException(
+ HttpErrorCodes.code(ErrorCatalogCodes.RESOURCE_NOT_FOUND),
+ e.errorMessageOrDefault(), e.errorCauseOrDefault()
+ )
val errorPayload = ErrorPayload(error.code, error.name, error.errorMessageOrDefault())
return errorPayload.toResponseEntity()
}
@ExceptionHandler
fun errorCatalogException(e: JpaObjectRetrievalFailureException): ResponseEntity<ErrorPayload> {
- val error = ErrorCatalogException(HttpErrorCodes.code(ErrorCatalogCodes.RESOURCE_NOT_FOUND),
- e.errorMessageOrDefault(), e.errorCauseOrDefault())
+ val error = ErrorCatalogException(
+ HttpErrorCodes.code(ErrorCatalogCodes.RESOURCE_NOT_FOUND),
+ e.errorMessageOrDefault(), e.errorCauseOrDefault()
+ )
val errorPayload = ErrorPayload(error.code, error.name, error.errorMessageOrDefault())
return errorPayload.toResponseEntity()
}
@ExceptionHandler
fun errorCatalogException(e: Exception): ResponseEntity<ErrorPayload> {
- val error = ErrorCatalogException(HttpErrorCodes.code(ErrorCatalogCodes.GENERIC_FAILURE),
- e.errorMessageOrDefault(), e.errorCauseOrDefault())
+ val error = ErrorCatalogException(
+ HttpErrorCodes.code(ErrorCatalogCodes.GENERIC_FAILURE),
+ e.errorMessageOrDefault(), e.errorCauseOrDefault()
+ )
val errorPayload = ErrorPayload(error.code, error.name, error.errorMessageOrDefault())
return errorPayload.toResponseEntity()
}
havingValue = ErrorMessageLibConstants.ERROR_CATALOG_TYPE_PROPERTIES
)
open class ErrorCatalogLoadPropertyService(private var errorCatalogProperties: ErrorCatalogProperties) :
- ErrorCatalogLoadService {
+ ErrorCatalogLoadService {
private val propertyFileName = ErrorMessageLibConstants.ERROR_CATALOG_PROPERTIES_FILENAME
private lateinit var propertyFile: File
inputStream = propertyFile.inputStream()
props.load(inputStream)
} catch (e: FileNotFoundException) {
- log.error("Application ID: ${errorCatalogProperties.applicationId} > Property File '$propertyFileName' " +
- "not found in the application directory.")
+ log.error(
+ "Application ID: ${errorCatalogProperties.applicationId} > Property File '$propertyFileName' " +
+ "not found in the application directory."
+ )
} catch (e: IOException) {
- log.error("Application ID: ${errorCatalogProperties.applicationId} > Fail to load property file " +
- "'$propertyFileName' for message errors.")
+ log.error(
+ "Application ID: ${errorCatalogProperties.applicationId} > Fail to load property file " +
+ "'$propertyFileName' for message errors."
+ )
} finally {
inputStream?.close()
}
package org.onap.ccsdk.cds.error.catalog.services
import kotlinx.coroutines.runBlocking
+import org.apache.commons.lang3.exception.ExceptionUtils
import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalog
import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogException
import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants
import org.onap.ccsdk.cds.error.catalog.core.GrpcErrorCodes
import org.onap.ccsdk.cds.error.catalog.core.HttpErrorCodes
import org.onap.ccsdk.cds.error.catalog.core.utils.ErrorCatalogUtils
-import org.apache.commons.lang3.exception.ExceptionUtils
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.stereotype.Service
import javax.annotation.PostConstruct
}
return ErrorCatalog(
- errorCatalogException.name,
- errorCatalogException.domain,
- errorCode,
- action,
- errorCause
+ errorCatalogException.name,
+ errorCatalogException.domain,
+ errorCode,
+ action,
+ errorCause
)
}
package org.onap.ccsdk.cds.error.catalog.services.domain
import java.io.Serializable
+import java.util.UUID
import javax.persistence.CascadeType
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.FetchType
import javax.persistence.Id
+import javax.persistence.JoinColumn
+import javax.persistence.JoinTable
import javax.persistence.Lob
import javax.persistence.ManyToMany
import javax.persistence.Table
import javax.persistence.UniqueConstraint
-import java.util.UUID
-import javax.persistence.JoinTable
-import javax.persistence.JoinColumn
/**
* Provide ErrorCode Entity
@Entity
@Table(name = "ERROR_DOMAINS", uniqueConstraints = [UniqueConstraint(columnNames = ["name", "application_id"])])
class Domain : Serializable {
+
@Id
var id: String = UUID.randomUUID().toString()
}
companion object {
+
private const val serialVersionUID = 1L
}
}
val domains: MutableSet<Domain> = mutableSetOf()
companion object {
+
private const val serialVersionUID = 1L
}
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-aggregator</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
<packaging>pom</packaging>
- <name>Micro-services Root</name>
- <description>Micro-services</description>
+ <name>MS (Root)</name>
+ <description>CDS Micro-services</description>
<modules>
<module>error-catalog</module>
<module>blueprintsprocessor</module>
- <module>py-executor</module>
<module>command-executor</module>
+ <module>py-executor</module>
<module>sdclistener</module>
</modules>
restart: always
volumes:
- blueprints-deploy:/opt/app/onap/blueprints/deploy
+ - ../certs:/opt/app/onap/python/certs
environment:
APPLICATIONNAME: PythonExecutor
BUNDLEVERSION: 1.0.0
FROM python:3.7-slim
-RUN groupadd -r -g 1000 onap && useradd -u 1000 -r -g onap onap
-
+USER root
RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log
+# add entrypoint
+COPY start.sh /opt/app/onap/py-executor/start.sh
+# add application
COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
+
RUN tar -xzf /source.tar.gz -C /tmp \
&& cp -rf /tmp/@project.build.finalName@/opt / \
&& rm -rf /source.tar.gz \
- && rm -rf /tmp/@project.build.finalName@
+ && rm -rf /tmp/@project.build.finalName@ \
+ && mkdir -p /opt/app/onap/blueprints/deploy \
+ && chmod 755 /opt/app/onap/py-executor/start.sh
+
+VOLUME /opt/app/onap/blueprints/deploy/
+RUN python -m pip install --upgrade pip setuptools
RUN pip install --no-cache-dir -r /opt/app/onap/python/requirements/docker.txt
-RUN mkdir -p /opt/app/onap/blueprints/deploy
+RUN groupadd -r -g 1000 onap && useradd -r -u 1000 -g onap onap
RUN chown onap:onap /opt -R
-
-VOLUME /opt/app/onap/blueprints/deploy/
USER onap
-ENTRYPOINT /opt/app/onap/python/start.sh
+ENTRYPOINT /opt/app/onap/py-executor/start.sh
<useDefaultExcludes>true</useDefaultExcludes>
<fileMode>0666</fileMode>
</fileSet>
- <fileSet>
- <directory>${project.basedir}/certs</directory>
- <outputDirectory>opt/app/onap/python/certs</outputDirectory>
- <useDefaultExcludes>true</useDefaultExcludes>
- <fileMode>0666</fileMode>
- </fileSet>
<fileSet>
<directory>${project.basedir}/docker</directory>
<outputDirectory>opt/app/onap/python</outputDirectory>
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>py-executor</artifactId>
- <name>Python Script Executor</name>
+ <name>MS Python Script Executor</name>
<description>Micro-service providing python environment with gRPC binding for python script execution</description>
<properties>
<assembly.id>maven</assembly.id>
<image.name>onap/ccsdk-py-executor</image.name>
- <docker.push.phase>deploy</docker.push.phase>
- <docker.verbose>true</docker.verbose>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
<sonar.skip>true</sonar.skip>
</properties>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.26.1</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
- <verbose>true</verbose>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
+ <id>build-push-images</id>
<phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
<parent>
<groupId>org.onap.ccsdk.cds.sdclistener</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>sdclistener-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
- <artifactId>application</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>sdclistener-application</artifactId>
<packaging>jar</packaging>
- <name>SDC Listener Application</name>
+ <name>MS SDC Listener - Application</name>
<properties>
<protobuf.version>3.6.1</protobuf.version>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>health-api-common</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${ccsdk.cds.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<groupId>org.onap.sdc.sdc-distribution-client</groupId>
<artifactId>sdc-distribution-client</artifactId>
</dependency>
-
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
+ <version>${jmockit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jacorb</groupId>
+ <artifactId>jacorb-omgapi</artifactId>
+ <version>3.8</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jacorb</groupId>
- <artifactId>jacorb-omgapi</artifactId>
- <version>3.8</version>
- <scope>test</scope>
- </dependency>
<!-- GRPC Dependencies -->
<dependency>
<groupId>io.grpc</groupId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
</dependency>
-
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>default-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <argLine>-Djdk.attach.allowAttachSelf=true ${surefireArgLine}</argLine>
- <excludes>
- <exclude>**/IT*.java</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <argLine>${surefireArgLine}</argLine>
- <excludes>
- <exclude>**/IT*.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
@SpringBootApplication
@EnableConfigurationProperties(SdcListenerConfiguration.class)
-@ComponentScan(basePackages = {"org.onap.ccsdk.cds.blueprintsprocessor.healthapi","org.onap.ccsdk.cds.sdclistener"})
+@ComponentScan(basePackages = {"org.onap.ccsdk.cds.blueprintsprocessor.healthapi", "org.onap.ccsdk.cds.sdclistener"})
public class SdcListenerApplication {
public static void main(String[] args) {
import java.util.List;
/**
- * In order to initiate a SDC distribution client we need to supply some pre-configuration values that
- * distribution client needs.
+ * In order to initiate a SDC distribution client we need to supply some pre-configuration values that distribution
+ * client needs.
*/
@ConfigurationProperties("listenerservice")
public class SdcListenerConfiguration implements IConfiguration {
/**
* Download the TOSCA CSAR artifact and process it.
*
- * @param info - Artifact information
+ * @param info - Artifact information
* @param distributionClient - SDC distribution client
*/
private void downloadCsarArtifacts(IArtifactInfo info, IDistributionClient distributionClient) {
if (!Objects.equals(result.getDistributionActionResult(), SUCCESS)) {
final String errorMessage = String.format("Failed to download the artifact from : %s due to %s ", url,
result.getDistributionActionResult());
- listenerStatus
- .sendResponseBackToSdc(distributionId, DistributionStatusEnum.DOWNLOAD_ERROR, errorMessage,
- url, NotificationType.DOWNLOAD);
+ listenerStatus.sendResponseBackToSdc(distributionId, DistributionStatusEnum.DOWNLOAD_ERROR,
+ errorMessage, url, NotificationType.DOWNLOAD);
LOGGER.error(errorMessage);
} else {
listenerStatus.sendResponseBackToSdc(distributionId, DistributionStatusEnum.DOWNLOAD_OK, null, url,
if (!csarFiles.isEmpty()) {
final String archivePath = cbaArchivePath.toString();
- //Extract CBA archive from CSAR package and store it into local disk
+ // Extract CBA archive from CSAR package and store it into local disk
csarFiles.forEach(file -> listenerService.extractBluePrint(file.getAbsolutePath(), archivePath));
csarFiles.forEach(file -> FileUtil.deleteFile(file, csarArchivePath.toString()));
} else {
@Override
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> methodDescriptor,
- CallOptions callOptions, Channel channel) {
+ CallOptions callOptions, Channel channel) {
Key<String> authHeader = Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER);
return new ForwardingClientCall.SimpleForwardingClientCall<ReqT, RespT>(
channel.newCall(methodDescriptor, callOptions)) {
result = this.distributionClient.start();
if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) {
- throw new SdcListenerException(
- "Startup of the SDC distribution client failed with reason: " + result.getDistributionMessageResult());
+ throw new SdcListenerException("Startup of the SDC distribution client failed with reason: "
+ + result.getDistributionMessageResult());
}
}
public class HealthCheck {
@RequestMapping(path = "/healthcheck", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public @ResponseBody
- Mono<String> ping() {
+ public @ResponseBody Mono<String> ping() {
return Mono.just("{\"status\":\"UP\"}");
}
}
public void setManagedChannelForGrpc() {
- managedChannel = ManagedChannelBuilder.forAddress(grpcAddress, grpcPort)
- .usePlaintext()
- .intercept(sdcListenerAuthClientInterceptor)
- .build();
+ managedChannel = ManagedChannelBuilder.forAddress(grpcAddress, grpcPort).usePlaintext()
+ .intercept(sdcListenerAuthClientInterceptor).build();
}
public ManagedChannel getManagedChannelForGrpc() {
/**
* @param message The message to dump
- * @param cause The Throwable cause object
+ * @param cause The Throwable cause object
*/
public SdcListenerException(final String message, final Throwable cause) {
super(message, cause);
/**
* Sending CBA archive to CDS backend to store into its Database.
*
- * @param request BluePrintManagementInput object holds CBA archive, its version and blueprints.
+ * @param request BluePrintManagementInput object holds CBA archive, its version and blueprints.
* @param managedChannel - ManagedChannel object helps to access the server or application end point.
*
* @return A response object
* Get the controller blueprint archive from CSAR package.
*
* @param csarArchivePath The path where CSAR archive is stored.
- * @param cbaArchivePath The destination path where CBA will be stored.
+ * @param cbaArchivePath The destination path where CBA will be stored.
*/
void extractBluePrint(String csarArchivePath, String cbaArchivePath);
/**
* Store the Zip file into CDS database.
*
- * @param path path where zip file exists.
+ * @param path path where zip file exists.
* @param managedChannel To access the blueprint processor application end point
*/
void saveBluePrintToCdsDatabase(Path path, ManagedChannel managedChannel);
/**
* Extract and store the csar package to local disk.
*
- * @param result - IDistributionClientDownloadResult contains payload.
+ * @param result - IDistributionClientDownloadResult contains payload.
* @param csarArchivePath The destination path where CSAR will be stored.
*/
void extractCsarAndStore(IDistributionClientDownloadResult result, Path csarArchivePath);
@Value("${listenerservice.config.grpcPort}")
private int grpcPort;
- private static final String CBA_ZIP_PATH = "Artifacts/[a-zA-Z0-9-_.]+/Deployment/CONTROLLER_BLUEPRINT_ARCHIVE/[a-zA-Z0-9-_.()]+[.]zip";
+ private static final String CBA_ZIP_PATH =
+ "Artifacts/[a-zA-Z0-9-_.]+/Deployment/CONTROLLER_BLUEPRINT_ARCHIVE/[a-zA-Z0-9-_.()]+[.]zip";
private static final int SUCCESS_CODE = 200;
private static final Logger LOGGER = LoggerFactory.getLogger(ListenerServiceImpl.class);
}
if (validPathCount == 0) {
- LOGGER
- .info("CBA archive doesn't exist in the CSAR Package or it doesn't exist as per the given path {}",
- CBA_ZIP_PATH);
- listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_OK, null,
- artifactUrl, SDC_LISTENER_COMPONENT);
+ LOGGER.info(
+ "CBA archive doesn't exist in the CSAR Package or it doesn't exist as per the given path {}",
+ CBA_ZIP_PATH);
+ listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_OK, null, artifactUrl,
+ SDC_LISTENER_COMPONENT);
}
} catch (Exception e) {
final String errorMessage = format("Failed to extract blueprint %s", e.getMessage());
- listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_ERROR, errorMessage,
- artifactUrl, SDC_LISTENER_COMPONENT);
+ listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_ERROR, errorMessage, artifactUrl,
+ SDC_LISTENER_COMPONENT);
LOGGER.error(errorMessage);
}
}
LOGGER.error("Could not able to create file {}", targetZipFile, e);
}
- try (InputStream inputStream = zipFile.getInputStream(entry); OutputStream out = new FileOutputStream(
- targetZipFile)) {
+ try (InputStream inputStream = zipFile.getInputStream(entry);
+ OutputStream out = new FileOutputStream(targetZipFile)) {
IOUtils.copy(inputStream, out);
LOGGER.info("Successfully store the CBA archive {} at this location", targetZipFile);
} catch (Exception e) {
if (responseStatus.getCode() != SUCCESS_CODE) {
final String errorMessage = format("Failed to store the CBA archive into CDS DB due to %s",
responseStatus.getErrorMessage());
- listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_ERROR, errorMessage, artifactUrl,
- SDC_LISTENER_COMPONENT);
+ listenerStatus.sendResponseBackToSdc(distributionId, COMPONENT_DONE_ERROR, errorMessage,
+ artifactUrl, SDC_LISTENER_COMPONENT);
LOGGER.error(errorMessage);
} else {
LOGGER.info(responseStatus.getMessage());
FileChunk fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(bytes)).build();
FileUtil.deleteFile(file, path);
return BluePrintUploadInput.newBuilder()
- .setCommonHeader(CommonHeader.newBuilder()
- .setRequestId(UUID.randomUUID().toString())
- .setSubRequestId(UUID.randomUUID().toString())
- .setOriginatorId("SDC-LISTENER")
- .build())
- .setActionIdentifiers(ActionIdentifiers.newBuilder()
- .setActionName(UploadAction.PUBLISH.toString()).build())
- .setFileChunk(fileChunk)
- .build();
+ .setCommonHeader(CommonHeader.newBuilder().setRequestId(UUID.randomUUID().toString())
+ .setSubRequestId(UUID.randomUUID().toString()).setOriginatorId("SDC-LISTENER").build())
+ .setActionIdentifiers(
+ ActionIdentifiers.newBuilder().setActionName(UploadAction.PUBLISH.toString()).build())
+ .setFileChunk(fileChunk).build();
}
private String getDistributionId() {
public enum NotificationType {
- DOWNLOAD,
- SDC_LISTENER_COMPONENT;
+ DOWNLOAD, SDC_LISTENER_COMPONENT;
}
/**
* Send the component status back to SDC.
*
* @param distributionID SDC Distribution ID
- * @param status Distribution status
- * @param errorReason Reason of failure if present
- * @param url Artifact URL
- * @param type - NotificationType(Download or Component)
+ * @param status Distribution status
+ * @param errorReason Reason of failure if present
+ * @param url Artifact URL
+ * @param type - NotificationType(Download or Component)
*/
public void sendResponseBackToSdc(String distributionID, DistributionStatusEnum status, String errorReason,
- String url, NotificationType type) {
+ String url, NotificationType type) {
final IDistributionClient distributionClient = sdcListenerDto.getDistributionClient();
switch (type) {
case SDC_LISTENER_COMPONENT:
- IComponentDoneStatusMessage componentStatusMessage = buildStatusMessage(distributionID, status, url,
- COMPONENT_NAME);
+ IComponentDoneStatusMessage componentStatusMessage =
+ buildStatusMessage(distributionID, status, url, COMPONENT_NAME);
if (errorReason == null) {
checkResponseStatusFromSdc(distributionClient.sendComponentDoneStatus(componentStatusMessage));
break;
case DOWNLOAD:
- IDistributionStatusMessage downloadStatusMessage = buildStatusMessage(distributionID, status, url,
- null);
+ IDistributionStatusMessage downloadStatusMessage =
+ buildStatusMessage(distributionID, status, url, null);
if (errorReason == null) {
checkResponseStatusFromSdc(distributionClient.sendDownloadStatus(downloadStatusMessage));
}
private ComponentStatusMessage buildStatusMessage(String distributionId, DistributionStatusEnum status, String url,
- String componentName) {
+ String componentName) {
return new BuilderUtil<>(new ComponentStatusMessage()).build(builder -> {
builder.setDistributionID(distributionId);
builder.setStatus(status);
try (Stream<Path> fileTree = walk(path)) {
// Get the list of files from the path
- return fileTree.filter(Files :: isRegularFile)
- .map(Path :: toFile)
- .collect(Collectors.toList());
+ return fileTree.filter(Files::isRegularFile).map(Path::toFile).collect(Collectors.toList());
} catch (IOException e) {
LOGGER.error("Failed to find the file due to", e);
}
import mockit.MockUp;
import mockit.Tested;
import mockit.VerificationsInOrder;
-import mockit.integration.junit4.JMockit;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.onap.ccsdk.cds.sdclistener.client.SdcListenerClient;
import org.onap.ccsdk.cds.sdclistener.dto.SdcListenerDto;
import org.onap.ccsdk.cds.sdclistener.exceptions.SdcListenerException;
import org.onap.sdc.impl.DistributionClientResultImpl;
import org.onap.sdc.utils.DistributionActionResultEnum;
-@RunWith(JMockit.class)
public class SdcListenerClientTest {
@Tested
@Test
public void testInitCdsClientSuccesfully(@Injectable IDistributionClient distributionClient,
- @Injectable SdcListenerConfiguration configuration,
- @Injectable SdcListenerNotificationCallback notification,
- @Injectable SdcListenerDto sdcListenerDto) throws SdcListenerException {
+ @Injectable SdcListenerConfiguration configuration,
+ @Injectable SdcListenerNotificationCallback notification, @Injectable SdcListenerDto sdcListenerDto)
+ throws SdcListenerException {
- //Arrange
+ // Arrange
new MockUp<DistributionClientFactory>() {
@Mock
public IDistributionClient createDistributionClient() {
}
};
- new Expectations() {{
- distributionClient.init(configuration, notification);
- result = getResult();
- }};
+ new Expectations() {
+ {
+ distributionClient.init(configuration, notification);
+ result = getResult();
+ }
+ };
- new Expectations() {{
- distributionClient.start();
- result = getResult();
- }};
+ new Expectations() {
+ {
+ distributionClient.start();
+ result = getResult();
+ }
+ };
// Act
sdcListenerClient.initSdcClient();
// Verify
- new VerificationsInOrder() {{
- distributionClient.init(configuration, notification);
- distributionClient.start();
- }};
+ new VerificationsInOrder() {
+ {
+ distributionClient.init(configuration, notification);
+ distributionClient.start();
+ }
+ };
}
public IDistributionClientResult getResult() {
*
*
*/
+
package org.onap.ccsdk.cds.sdclistener.dto;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@RunWith(SpringRunner.class)
-@EnableConfigurationProperties({SdcListenerDto.class,SdcListenerAuthClientInterceptor.class})
+@EnableConfigurationProperties({SdcListenerDto.class, SdcListenerAuthClientInterceptor.class})
@SpringBootTest(classes = {SdcListenerDtoTest.class})
public class SdcListenerDtoTest {
*
*
*/
+
package org.onap.ccsdk.cds.sdclistener.exceptions;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+
public class SdcListenerExceptionTest {
@Test
public void testConstructor() {
- final String s1="Exception occured";
- SdcListenerException sle=new SdcListenerException(s1);
- assertEquals(sle.getMessage(),"Exception occured");
+ final String s1 = "Exception occured";
+ SdcListenerException sle = new SdcListenerException(s1);
+ assertEquals(sle.getMessage(), "Exception occured");
}
}
final BluePrintManagementServiceImplBase serviceImplBase = new BluePrintManagementServiceImplBase() {
@Override
public void uploadBlueprint(BluePrintUploadInput request,
- StreamObserver<BluePrintManagementOutput> responseObserver) {
+ StreamObserver<BluePrintManagementOutput> responseObserver) {
responseObserver.onNext(getBluePrintManagementOutput());
responseObserver.onCompleted();
}
String serverName = InProcessServerBuilder.generateName();
// Create a server, add service, start, and register.
- grpcCleanup.register(
- InProcessServerBuilder.forName(serverName).addService(serviceImplBase).directExecutor().build().start());
+ grpcCleanup.register(InProcessServerBuilder.forName(serverName).addService(serviceImplBase).directExecutor()
+ .build().start());
// Create a client channel.
channel = grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build());
FileChunk fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(bytes)).build();
return BluePrintUploadInput.newBuilder()
- .setCommonHeader(CommonHeader.newBuilder()
- .setRequestId(UUID.randomUUID().toString())
- .setSubRequestId(UUID.randomUUID().toString())
- .setOriginatorId("SDC-LISTENER")
- .build())
- .setActionIdentifiers(ActionIdentifiers.newBuilder()
- .setActionName(UploadAction.PUBLISH.toString()).build())
+ .setCommonHeader(CommonHeader.newBuilder().setRequestId(UUID.randomUUID().toString())
+ .setSubRequestId(UUID.randomUUID().toString()).setOriginatorId("SDC-LISTENER").build())
+ .setActionIdentifiers(
+ ActionIdentifiers.newBuilder().setActionName(UploadAction.PUBLISH.toString()).build())
.setFileChunk(fileChunk).build();
}
private BluePrintManagementOutput getBluePrintManagementOutput() {
return BluePrintManagementOutput.newBuilder()
- .setStatus(Status.newBuilder().setMessage(SUCCESS_MSG).setCode(200).build())
- .build();
+ .setStatus(Status.newBuilder().setMessage(SUCCESS_MSG).setCode(200).build()).build();
}
}
import static org.onap.sdc.utils.DistributionStatusEnum.COMPONENT_DONE_OK;
@RunWith(SpringRunner.class)
-@EnableConfigurationProperties({SdcListenerAuthClientInterceptor.class,
- BluePrintProcesssorHandler.class, SdcListenerDto.class, ListenerServiceImpl.class, SdcListenerStatus.class,
- SdcListenerConfiguration.class})
+@EnableConfigurationProperties({SdcListenerAuthClientInterceptor.class, BluePrintProcesssorHandler.class,
+ SdcListenerDto.class, ListenerServiceImpl.class, SdcListenerStatus.class, SdcListenerConfiguration.class})
@SpringBootTest(classes = {ListenerServiceImplTest.class})
public class ListenerServiceImplTest {
private static final String CSAR_SAMPLE = "src/test/resources/service-ServicePnfTest-csar.csar";
private static final String WRONG_CSAR_SAMPLE = "src/test/resources/wrong_csar_pattern.csar";
- private static final String CBA_ZIP_PATH = "Artifacts/[a-zA-Z0-9-_.]+/Deployment/CONTROLLER_BLUEPRINT_ARCHIVE/[a-zA-Z0-9-_.()]+[.]zip";
+ private static final String CBA_ZIP_PATH =
+ "Artifacts/[a-zA-Z0-9-_.]+/Deployment/CONTROLLER_BLUEPRINT_ARCHIVE/[a-zA-Z0-9-_.()]+[.]zip";
private static final String ZIP_FILE = ".zip";
private static final String CSAR_FILE = ".csar";
private static final String DISTRIBUTION_ID = "1";
// Arrange
Mockito.when(listenerDto.getDistributionId()).thenReturn(DISTRIBUTION_ID);
Mockito.when(listenerDto.getArtifactUrl()).thenReturn(URL);
- Mockito.doCallRealMethod().when(status)
- .sendResponseBackToSdc(DISTRIBUTION_ID, COMPONENT_DONE_OK, null, URL, SDC_LISTENER_COMPONENT);
+ Mockito.doCallRealMethod().when(status).sendResponseBackToSdc(DISTRIBUTION_ID, COMPONENT_DONE_OK, null, URL,
+ SDC_LISTENER_COMPONENT);
// Act
listenerService.extractBluePrint(WRONG_CSAR_SAMPLE, tempDirectoryPath.toString());
// Verify
- Mockito.verify(status)
- .sendResponseBackToSdc(DISTRIBUTION_ID, COMPONENT_DONE_OK, null, URL, SDC_LISTENER_COMPONENT);
+ Mockito.verify(status).sendResponseBackToSdc(DISTRIBUTION_ID, COMPONENT_DONE_OK, null, URL,
+ SDC_LISTENER_COMPONENT);
}
@Test
}
private String checkFileExists(Path path) throws IOException {
- return Files.walk(path)
- .filter(Files :: isRegularFile)
- .map(Path :: toFile)
- .findAny()
- .get()
- .getName();
+ return Files.walk(path).filter(Files::isRegularFile).map(Path::toFile).findAny().get().getName();
}
public byte[] convertFileToByteArray(File file) {
return null;
}
- public class DistributionClientDownloadResultStubImpl extends DistributionClientResultStubImpl implements
- IDistributionClientDownloadResult {
+ public class DistributionClientDownloadResultStubImpl extends DistributionClientResultStubImpl
+ implements IDistributionClientDownloadResult {
- public DistributionClientDownloadResultStubImpl() {
- }
+ public DistributionClientDownloadResultStubImpl() {}
public byte[] getArtifactPayload() {
File file = Paths.get(CSAR_SAMPLE).toFile();
+/*
+ * Copyright © 2020 AT&T.
+ *
+ * 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.sdclistener.status;
import org.junit.Test;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {ComponentStatusMessageTest.class})
public class ComponentStatusMessageTest {
- ComponentStatusMessage componentStatusMsg= new ComponentStatusMessage();
+ ComponentStatusMessage componentStatusMsg = new ComponentStatusMessage();
@Test
public void testComponentStatusMessage() {
*
*
*/
+
package org.onap.ccsdk.cds.sdclistener.util;
import org.junit.Test;
@SpringBootTest(classes = {FileUtilTest.class})
public class FileUtilTest {
- FileUtil fs;
+ FileUtil fs;
@Test
public void testDeleteFile() throws IOException {
File tempFile = File.createTempFile("tempFile", ".txt");
-// System.out.println(tempFile.getRoot());
- fs.deleteFile(tempFile,tempFile.getAbsolutePath());
+ // System.out.println(tempFile.getRoot());
+ fs.deleteFile(tempFile, tempFile.getAbsolutePath());
assertFalse(tempFile.exists());
}
@Test
- public void testGetFilesFromDisk() throws IOException{
+ public void testGetFilesFromDisk() throws IOException {
- Path resourceDirectory = Paths.get("src","test","resources");
- int totalfile=resourceDirectory.getNameCount();
- List fileList=fs.getFilesFromDisk(resourceDirectory);
+ Path resourceDirectory = Paths.get("src", "test", "resources");
+ int totalfile = resourceDirectory.getNameCount();
+ List fileList = fs.getFilesFromDisk(resourceDirectory);
assertNotNull(fileList);
- assertEquals(fileList.size(),totalfile);
+ assertEquals(fileList.size(), totalfile);
}
<parent>
<groupId>org.onap.ccsdk.cds.sdclistener</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>sdclistener-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
- <artifactId>distribution</artifactId>
+ <artifactId>sdclistener-distribution</artifactId>
<packaging>pom</packaging>
- <name>SDC Listener Distribution</name>
+ <name>MS SDC Listener - Distribution</name>
<properties>
<assembly.id>maven</assembly.id>
<image.name>onap/ccsdk-sdclistener</image.name>
<!--disabled for now to mirror #85964 https://gerrit.onap.org/r/#/c/85964/2/ms/command-executor/pom.xml-->
<!--<docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>-->
- <docker.push.phase>deploy</docker.push.phase>
- <docker.verbose>true</docker.verbose>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
- <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
</properties>
<dependencies>
<dependency>
<groupId>org.onap.ccsdk.cds.sdclistener</groupId>
- <artifactId>application</artifactId>
+ <artifactId>sdclistener-application</artifactId>
</dependency>
</dependencies>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.26.1</version>
+ <version>0.34.0</version>
<inherited>false</inherited>
<configuration>
<images>
</build>
</image>
</images>
- <verbose>true</verbose>
+ <verbose>${docker.verbose}</verbose>
+ <skipPush>${docker.skip.push}</skipPush>
</configuration>
<executions>
<execution>
- <id>generate-images</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
+ <id>build-push-images</id>
<phase>${docker.push.phase}</phase>
<goals>
<goal>build</goal>
-FROM openjdk:8-jdk-alpine
+FROM onap/ccsdk-alpine-j11-image:1.0.1
-RUN addgroup -S -g 1000 onap && adduser -S onap -u 1000 -G onap
+USER root
# add entrypoint
-COPY startService.sh /startService.sh
-RUN chown onap:onap /startService.sh
-RUN chmod 751 /startService.sh
+COPY startService.sh /opt/app/onap/sdc-listener/startService.sh
# add application
COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
+
RUN tar -xzf /source.tar.gz -C /tmp \
&& cp -rf /tmp/@project.build.finalName@/opt / \
&& rm -rf /source.tar.gz \
- && rm -rf /tmp/@project.build.finalName@
-
-RUN mkdir -p /opt/app/onap/cds-sdc-listener
-RUN chown onap:onap /opt -R
+ && rm -rf /tmp/@project.build.finalName@ \
+ && mkdir -p /opt/app/onap/cds-sdc-listener \
+ && chown onap:onap /opt -R \
+ && chmod 755 /opt/app/onap/sdc-listener/startService.sh
USER onap
-ENTRYPOINT /startService.sh
+ENTRYPOINT /opt/app/onap/sdc-listener/startService.sh
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
<artifactId>sdclistener</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.sdclistener</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>sdclistener-parent</artifactId>
<packaging>pom</packaging>
- <name>SDC Listener Parent</name>
- <description>SDC Listener Parent</description>
+ <name>MS SDC Listener - Parent</name>
<properties>
<eelf.version>1.0.0</eelf.version>
<dmaap.client.version>1.1.5</dmaap.client.version>
<mockkserver.version>5.5.1</mockkserver.version>
<sdc-distribution-client.version>1.4.0</sdc-distribution-client.version>
- <jmockit.version>1.19</jmockit.version>
+ <jmockit.version>1.49</jmockit.version>
<reactorcore.version>3.2.6.RELEASE</reactorcore.version>
</properties>
<artifactId>commons-compress</artifactId>
<version>1.15</version>
</dependency>
-
- <dependency>
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<version>${protobuff.java.utils.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
<version>${project.version}</version>
<exclusions>
<!-- SDC Distribution client dependency -->
<dependency>
<groupId>org.onap.ccsdk.cds.sdclistener</groupId>
- <artifactId>application</artifactId>
+ <artifactId>sdclistener-application</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.5.1</version>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin.version}</version>
<configuration>
- <source>${maven.compiler.source}</source>
- <target>${maven.compiler.target}</target>
+ <!-- Sets the VM argument line used when unit tests are run. -->
+ <argLine>-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar</argLine>
+ <!-- Excludes integration tests when unit tests are run. -->
+ <excludes>
+ <exclude>**/IT*.java</exclude>
+ </excludes>
</configuration>
</plugin>
</plugins>
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>ms</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-ms</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sdclistener</artifactId>
<packaging>pom</packaging>
- <name>SDC Listener Root</name>
- <description>SDC Listener Root</description>
+ <name>MS SDC Listener (Root)</name>
<modules>
<module>parent</module>
<properties>
<service.name>sdclistener</service.name>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <build.number>${maven.build.timestamp}</build.number>
- <java.version>1.8</java.version>
- <maven.compiler.target>1.8</maven.compiler.target>
- <maven.compiler.source>1.8</maven.compiler.source>
- <ccsdk.project.version>${project.version}</ccsdk.project.version>
+
</properties>
</project>
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.1-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.onap.ccsdk.cds</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>cds-aggregator</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>CDS Parent</name>
+ <name>Aggregator</name>
<description>CCSDK Controller Design Studio</description>
<url>https://wiki.onap.org</url>
<organization>
<!-- Properties for POM Format -->
<format.skipValidate>false</format.skipValidate>
<format.skipExecute>true</format.skipExecute>
+ <java.version>11</java.version>
+ <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
+ <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
+
+ <!-- docker related properties -->
+ <docker.verbose>true</docker.verbose>
+ <docker.skip.push>false</docker.skip.push>
+ <docker.push.phase>deploy</docker.push.phase>
+ <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+
+ <ccsdk.cds.version>${project.version}</ccsdk.cds.version>
</properties>
<build>
+ <pluginManagement>
+ <plugins>
+ <!--TODO: This plugin is broken. Find replacement-->
+ <!-- Plugin to Format/Validate POM Files -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tidy-maven-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <id>format-pom</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>pom</goal>
+ </goals>
+ <configuration>
+ <skip>${format.skipExecute}</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>validate-pom</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <skip>${format.skipValidate}</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Plugin to Format/Validate Kotlin Files -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${maven-antrun-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>validate-kotlin</id>
+ <phase>validate</phase>
+ <configuration>
+ <target name="ktlint">
+ <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
+ <arg value="src/**/*.kt"/>
+ <arg value="Scripts/**/*.kt"/>
+ </java>
+ </target>
+ <skip>${format.skipValidate}</skip>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>format-kotlin</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <target name="ktlint">
+ <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
+ <arg value="-F"/>
+ <arg value="src/**/*.kt"/>
+ <arg value="Scripts/**/*.kt"/>
+ </java>
+ </target>
+ <skip>${format.skipExecute}</skip>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>com.pinterest</groupId>
+ <artifactId>ktlint</artifactId>
+ <version>0.39.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <!-- Plugin to identify root path of the project -->
+ <plugin>
+ <groupId>org.commonjava.maven.plugins</groupId>
+ <artifactId>directory-maven-plugin</artifactId>
+ <version>0.3</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <id>directories</id>
+ <goals>
+ <goal>highest-basedir</goal>
+ </goals>
+ <configuration>
+ <property>baseDirPath</property>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Plugin to Format/Validate Java Classes -->
+ <plugin>
+ <groupId>net.revelc.code.formatter</groupId>
+ <artifactId>formatter-maven-plugin</artifactId>
+ <version>2.12.0</version>
+ <executions>
+ <execution>
+ <id>format-java</id>
+ <goals>
+ <goal>format</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <lineEnding>LF</lineEnding>
+ <skip>${format.skipExecute}</skip>
+ <sourceDirectory>${project.basedir}</sourceDirectory>
+ <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
+ <includes>
+ <include>src/**/*.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>validate-java</id>
+ <goals>
+ <goal>validate</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <lineEnding>LF</lineEnding>
+ <skip>${format.skipValidate}</skip>
+ <sourceDirectory>${project.basedir}</sourceDirectory>
+ <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
+ <includes>
+ <include>src/**/*.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson-bom.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin.version}</version>
+ <configuration>
+ <!-- Sets the VM argument line used when unit tests are run. -->
+ <argLine>${surefireArgLine}</argLine>
+ <!-- Excludes integration tests when unit tests are run. -->
+ <excludes>
+ <exclude>**/IT*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
+ <executions>
+ <!-- Ensures that both integration-test and verify goals of the Failsafe Maven plugin are executed. -->
+ <execution>
+ <id>integration-tests</id>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <!-- Sets the VM argument line used when integration tests are run. -->
+ <argLine>${failsafeArgLine}</argLine>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-maven-plugin</artifactId>
+ <version>${kotlin.maven.version}</version>
+ <configuration>
+ <jvmTarget>${java.version}</jvmTarget>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <release>${java.version}</release>
+ <!--explicitly remove source and target-->
+ <source combine.self="override"/>
+ <target combine.self="override"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
-
- <!-- Plugin to Format/Validate POM Files -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tidy-maven-plugin</artifactId>
- <version>1.1.0</version>
- <executions>
- <execution>
- <id>format-pom</id>
- <phase>process-sources</phase>
- <goals>
- <goal>pom</goal>
- </goals>
- <configuration>
- <skip>${format.skipExecute}</skip>
- </configuration>
- </execution>
- <execution>
- <id>validate-pom</id>
- <phase>validate</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <skip>${format.skipValidate}</skip>
- </configuration>
- </execution>
- </executions>
</plugin>
-
- <!-- Plugin to Format/Validate Kotlin Files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>validate-kotlin</id>
- <phase>validate</phase>
- <configuration>
- <target name="ktlint">
- <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
- <arg value="src/**/*.kt"/>
- </java>
- </target>
- <skip>${format.skipValidate}</skip>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <!-- Built-in formatter So that you wouldn't have to fix all style violations by hand.-->
- <id>format-kotlin</id>
- <phase>process-sources</phase>
- <configuration>
- <target name="ktlint">
- <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
- <arg value="-F"/>
- <arg value="src/**/*.kt"/>
- </java>
- </target>
- <skip>${format.skipExecute}</skip>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>com.pinterest</groupId>
- <artifactId>ktlint</artifactId>
- <version>0.35.0</version>
- </dependency>
- </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.commonjava.maven.plugins</groupId>
+ <artifactId>directory-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>net.revelc.code.formatter</groupId>
+ <artifactId>formatter-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
--- /dev/null
+---
+distribution_type: 'container'
+container_release_tag: '1.0.0'
+project: 'ccsdk-cds'
+log_dir: 'ccsdk-cds-maven-docker-stage-master/464/'
+ref: 7d397bd49ffc2c61d70aa65353f2188bc1264abb
+containers:
+ - name: 'ccsdk-blueprintsprocessor'
+ version: '1.0.0-STAGING-20200921T161620Z'
+ - name: 'ccsdk-commandexecutor'
+ version: '1.0.0-STAGING-20200921T161620Z'
+ - name: 'ccsdk-py-executor'
+ version: '1.0.0-STAGING-20200921T161620Z'
+ - name: 'ccsdk-sdclistener'
+ version: '1.0.0-STAGING-20200921T161620Z'
+ - name: 'ccsdk-cds-ui-server'
+ version: '1.0.0-STAGING-20200921T161620Z'
+ - name: 'ccsdk-cds-ui'
+ version: '1.0.0-STAGING-20200921T161620Z'
--- /dev/null
+---
+distribution_type: 'maven'
+version: '1.0.0'
+project: 'ccsdk-cds'
+log_dir: 'ccsdk-cds-maven-stage-master/364/'
release_name=1
-sprint_number=0
+sprint_number=1
feature_revision=0
base_version=${release_name}.${sprint_number}.${feature_revision}