summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java
blob: 9aa53547c88ed97a4efa5bae412c8ffa45ef84da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
}
/* #rightContentUiDashboard {
	display:inline-block;
} */

#rightContentUiDashboard .browsehappy {
  margin: 0.2em 0;
  background: #ccc;
  color: #000;
  padding: 0.2em 0;
}
#rightContentUiDashboard .thumbnail {
  height: 200px;
}
#rightContentUiDashboard .thumbnail img.pull-right {
  width: 50px;
}
#rightContentUiDashboard body {
  margin: 15px;
  padding-top: 50px;
}
#rightContentUiDashboard a {
  cursor: pointer;
}
#rightContentUiDashboard .layout-tabs {
  margin-bottom: 10px;
}
#rightContentUiDashboard .demo-widget-fluid {
  border: 1px solid blue;
  height: 100%;
}
#rightContentUiDashboard .demo-widget-fluid > div {
  border: 1px solid red;
  position: relative;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
#rightContentUiDashboard .dashboard-widget-area {
  margin: 10px 0 30px;
  min-height: 200px;
}
#rightContentUiDashboard .widget-container {
  float: left;
  display: inline-block;
  width: 33%;
  padding-bottom: 0em;
}
#rightContentUiDashboard .widget {
  margin: 0 1em 0 0;
  background-color: white;
  border-radius: 5px;
  position: relative;
  height: 100%;
}
#rightContentUiDashboard .widget-header {
  overflow: hidden;
  width:100%;  /* for overlaying effect start*/
  position: absolute;
  z-index: 10;
  opacity: 0.8;
  top: 1px;
  filter: alpha(opacity=80); /* For IE8 and earlier */
    -webkit-transition: width 2s, height 4s; /* Safari */
    transition: width 2s, height 4s;
}
#rightContentUiDashboard .widget-header .label {
  display: inline-block;
  vertical-align: middle;
}
#rightContentUiDashboard .widget-header .glyphicon {
  cursor: pointer;
  float: right;
  opacity: 0.5;
  margin-left: 5px;
}
#rightContentUiDashboard .widget-header .glyphicon:hover {
  opacity: 1;
}
#rightContentUiDashboard .widget-header .widget-title {
  vertical-align: middle;
}
#rightContentUiDashboard .widget-header form.widget-title {
  display: inline;
}
#rightContentUiDashboard .widget-header form.widget-title input.form-control {
  width: auto;
  display: inline-block;
}
#rightContentUiDashboard .widget-content {
	padding:0px;	
	overflow: hidden;	
	position: relative;	/* for overlaying effect */
}
#rightContentUiDashboard .widget .widget-ew-resizer {
  position: absolute;
  width: 5px;
  right: -2px;
  height: 100%;
  top: 0;
  cursor: ew-resize;
}
#rightContentUiDashboard .widget .widget-s-resizer {
  cursor: ns-resize;
  height: 5px;
  width: 100%;
  bottom: -7px;
  left: 0;
}
#rightContentUiDashboard .widget .widget-resizer-marquee {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); 
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}
#rightContentUiDashboard .remove-layout-icon {
  vertical-align: text-top;
  cursor: pointer;
  opacity: 0.3;
}
#rightContentUiDashboard .remove-layout-icon:hover {
  opacity: 1;
}
#rightContentUiDashboard .layout-title {
  display: inline-block;
}

/* 
#container {
  width: 100px;
  height: 100px;
  position: relative;
}
#navi,
#infoi {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
#infoi {
  z-index: 10;
}

 */
">= new GetInput(); replica.setBpInputName("replicas"); this.setReplicas(replica); LinkedHashMap<String, Object> rep = createIntegerInput("number of instances", 1); retInputs.put("replicas", rep); //set the dns name //this.setDns_name(cs.getSelf().getName()); //set the name //this.setName(cs.getSelf().getName()); //set the docker config Auxilary aux = componentSpec.getAuxilary(); // if(aux.getPorts() != null) { // retInputs = aux.createPorts(retInputs); // } this.setDocker_config(aux); //set the app config Appconfig app = new Appconfig(); retInputs = app.createAppconfig(retInputs, componentSpec, override, false); this.setApplication_config(app); // set always_pull_image this.always_pull_image = new GetInput(); this.always_pull_image.setBpInputName("always_pull_image"); LinkedHashMap<String, Object> inputAlwaysPullImage = createBooleanInput( "Set to true if the image should always be pulled", true); retInputs.put("always_pull_image", inputAlwaysPullImage); //set service component type String serviceComponentType = componentSpec.getSelfName().replace('.', '-'); this.setService_component_type(serviceComponentType); //set the tls info for internal and external communication TreeMap<String, Object> tls_info = componentSpec.getAuxilary().getTls_info(); if (tls_info != null) { addTlsInfo(componentSpec, retInputs); if (tls_info.get(USE_EXTERNAL_TLS_FIELD) != null) { retInputs.putAll(addExternalTlsInfo(componentSpec)); } } //set the reource config ResourceConfig resource = new ResourceConfig(); retInputs = resource.createResourceConfig(retInputs, componentSpec.getSelf().getName()); this.setResource_config(resource); return retInputs; } public TreeMap<String, LinkedHashMap<String, Object>> createDmaapProperties( TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec componentSpec, String override) { TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps; //set the image GetInput image = new GetInput(); image.setBpInputName("tag_version"); this.setImage(image); retInputs.put("tag_version", createStringInput(componentSpec.getImageUri())); //set the location id GetInput location = new GetInput(); location.setBpInputName("location_id"); this.setLocation_id(location); retInputs.put("location_id", createStringInput(EMPTY_VALUE)); //set the log info this.setLog_info(componentSpec.getAuxilary().getLog_info()); //set service component type String serviceComponentType = componentSpec.getSelfName().replace('.', '-'); this.setService_component_type(serviceComponentType); //set the tls info for internal and external communication TreeMap<String, Object> tls_info = componentSpec.getAuxilary().getTls_info(); if (tls_info != null) { addTlsInfo(componentSpec, retInputs); if (tls_info.get(USE_EXTERNAL_TLS_FIELD) != null) { retInputs.putAll(addExternalTlsInfo(componentSpec)); } } //set the replicas GetInput replica = new GetInput(); replica.setBpInputName("replicas"); this.setReplicas(replica); LinkedHashMap<String, Object> rep = createIntegerInput("number of instances", 1); retInputs.put("replicas", rep); // //set the dns name // this.setDns_name(cs.getSelf().getName()); // //set the name // this.setName(cs.getSelf().getName()); //set the docker config Auxilary aux = componentSpec.getAuxilary(); // if(aux.getPorts() != null) { // retInputs = aux.createPorts(retInputs); // } this.setDocker_config(aux); //set the appconfig Appconfig app = new Appconfig(); retInputs = app.createAppconfig(retInputs, componentSpec, override, true); this.setApplication_config(app); //set the stream publishes ArrayList<DmaapStreams> pubStreams = new ArrayList<>(); if (componentSpec.getStreams().getPublishes() != null) { for (Publishes publishes : componentSpec.getStreams().getPublishes()) { if (isMessageRouterType(publishes.getType())) { String topic = publishes.getConfig_key() + "_topic"; DmaapStreams mrStreams = new DmaapStreams(); retInputs = mrStreams .createStreams(inps, componentSpec, topic, publishes.getType(), publishes.getConfig_key(), publishes.getRoute(), 'p'); pubStreams.add(mrStreams); } else if (isDataRouterType(publishes.getType())) { String feed = publishes.getConfig_key() + "_feed"; DmaapStreams drStreams = new DmaapStreams(); retInputs = drStreams .createStreams(inps, componentSpec, feed, publishes.getType(), publishes.getConfig_key(), publishes.getRoute(), 'p'); pubStreams.add(drStreams); } } } //set the stream subscribes ArrayList<DmaapStreams> subStreams = new ArrayList<>(); if (componentSpec.getStreams().getSubscribes() != null) { for (Subscribes subscribes : componentSpec.getStreams().getSubscribes()) { if (isMessageRouterType(subscribes.getType())) { String topic = subscribes.getConfig_key() + "_topic"; DmaapStreams mrStreams = new DmaapStreams(); retInputs = mrStreams .createStreams(inps, componentSpec, topic, subscribes.getType(), subscribes.getConfig_key(), subscribes.getRoute(), 's'); subStreams.add(mrStreams); } else if (isDataRouterType(subscribes.getType())) { String feed = subscribes.getConfig_key() + "_feed"; DmaapStreams drStreams = new DmaapStreams(); retInputs = drStreams .createStreams(inps, componentSpec, feed, subscribes.getType(), subscribes.getConfig_key(), subscribes.getRoute(), 's'); subStreams.add(drStreams); } } } if (!pubStreams.isEmpty()) { this.setStreams_publishes(pubStreams); } if (!subStreams.isEmpty()) { this.setStreams_subscribes(subStreams); } //set the reource config ResourceConfig resource = new ResourceConfig(); retInputs = resource.createResourceConfig(retInputs, componentSpec.getSelf().getName()); this.setResource_config(resource); return retInputs; } private void addTlsInfo(ComponentSpec cs, TreeMap<String, LinkedHashMap<String, Object>> retInputs) { TlsInfo tlsInfo = new TlsInfo(); tlsInfo.setCertDirectory((String) cs.getAuxilary().getTls_info().get("cert_directory")); GetInput useTLSFlag = new GetInput(); useTLSFlag.setBpInputName("use_tls"); tlsInfo.setUseTls(useTLSFlag); this.setTls_info(tlsInfo); LinkedHashMap<String, Object> useTlsFlagInput = createBooleanInput( "flag to indicate tls enable/disable", cs.getAuxilary().getTls_info().get("use_tls")); retInputs.put("use_tls", useTlsFlagInput); } private Map<String, LinkedHashMap<String, Object>> addExternalTlsInfo(ComponentSpec cs) { this.setExternal_cert(externalCertFactory.createFromComponentSpec(cs)); return externalCertFactory.createInputListFromComponentSpec(cs); } }