1 /**============LICENSE_START=======================================================
3 ================================================================================
4 Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ============LICENSE_END=========================================================
21 package org.onap.blueprintgenerator.models.blueprint;
23 import java.util.ArrayList;
24 import java.util.LinkedHashMap;
25 import java.util.TreeMap;
27 import org.onap.blueprintgenerator.models.componentspec.ComponentSpec;
29 import com.fasterxml.jackson.annotation.JsonInclude;
30 import com.fasterxml.jackson.annotation.JsonInclude.Include;
32 import lombok.Getter; import lombok.Setter;
35 @JsonInclude(value=Include.NON_NULL)
36 public class StartInputs {
37 //private ArrayList<String> ports;
38 private GetInput envs;
40 public TreeMap<String, LinkedHashMap<String, Object>> createOnapStartInputs(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs){
41 TreeMap<String, LinkedHashMap<String, Object>> retInputs = new TreeMap<String, LinkedHashMap<String, Object>>();
43 LinkedHashMap<String, Object> stringType = new LinkedHashMap<String, Object>();
45 // ArrayList<String> port = new ArrayList<String>();
46 // String external = "";
47 // if(cs.getAuxilary().getPorts() != null) {
48 // for(String s: cs.getAuxilary().getPorts()) {
50 // String portNumber = "";
51 // StringBuffer buf = new StringBuffer();
52 // for(int i = 0; i < s.length(); i++) {
53 // if(!(s.charAt(i) == ':')) {
54 // buf.append(s.charAt(i));
57 // external = s.replace(buf.toString() + ":", "");
61 // portNumber = buf.toString();
62 // String p = "concat: [" + '"' + portNumber + ":" + '"' +", {get_input: external_port }]";
66 // this.setPorts(port);
67 // //add the external port input
68 // if(cs.getAuxilary().getPorts() != null) {
69 // stringType.put("type", "string");
70 // stringType.put("description", "Kubernetes node port on which collector is exposed");
71 // stringType.put("default", "'" + external + "'") ;
72 // retInputs.put("external_port", stringType);
76 GetInput env = new GetInput();
77 env.setGet_input("envs");
79 LinkedHashMap<String, Object> eMap = new LinkedHashMap();
80 eMap.put("default", "{}");
81 retInputs.put("envs", eMap);