1 /*******************************************************************************
2 * =============LICENSE_START=========================================================
4 * =================================================================================
5 * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 *******************************************************************************/
22 package org.onap.ccsdk.dashboard.model.deploymenthandler;
24 import java.util.Collection;
25 import java.util.LinkedList;
27 import java.util.Optional;
29 import com.fasterxml.jackson.annotation.JsonCreator;
30 import com.fasterxml.jackson.annotation.JsonProperty;
33 * Model for message POST-ed to controller to create a Deployment via the
34 * Deployment Handler API:
39 "deploymentTag" : "tag",
40 "blueprintName" : "name",
41 "blueprintVersion" : "version",
42 "blueprintId" : "bp_id",
45 "input1" : "parameter1",
46 "input2" : "parameter2",
48 "inputn" : "parametern"
50 "tenant" : "tenant_name"
54 * THIS OBJECT INCLUDES THE DEPLOYMENTID CREATED BY THE USER!
56 public class DeploymentInput {
58 /** component or namespace for the service */
59 private final String component;
61 /** tag to identify the deployment */
62 private final String tag;
64 /** The blueprint name for the service to be deployed. */
65 private final String blueprintName;
67 /** blueprint version for the service to be deployed */
68 private final Optional<Integer> blueprintVersion;
70 /** blueprint typeId from inventory */
71 private final Optional<String> blueprintId;
73 /** The cloudify tenant name for the deployment */
74 private final String tenant;
76 * Object containing inputs needed by the service blueprint to create an
77 * instance of the service. Content of the object depends on the service being
80 private final Map<String, Object> inputs;
82 private final Collection<String> reinstall_list;
84 private final boolean skip_install;
86 private final boolean skip_uninstall;
88 private final boolean skip_reinstall;
90 private final boolean force;
92 private final boolean ignore_failure;
94 private final boolean install_first;
97 public DeploymentInput(@JsonProperty("component") String component, @JsonProperty("tag") String tag,
98 @JsonProperty("blueprintName") String blueprintName,
99 @JsonProperty("blueprintVersion") Integer blueprintVersion, @JsonProperty("blueprintId") String blueprintId,
100 @JsonProperty("inputs") Map<String, Object> inputs, @JsonProperty("tenant") String tenant,
101 @JsonProperty("reinstall_list") Collection<String> reinstallList,
102 @JsonProperty("skip_install") boolean skipInstall,
103 @JsonProperty("skip_uninstall") boolean skipUninstall,
104 @JsonProperty("skip_reinstall") boolean skipReinstall,
105 @JsonProperty("force") boolean force,
106 @JsonProperty("ignore_failure") boolean ignoreFailure,
107 @JsonProperty("install_first") boolean installFirst) {
108 this.component = component;
110 this.blueprintName = blueprintName;
111 this.blueprintVersion = Optional.ofNullable(blueprintVersion);
112 this.blueprintId = Optional.ofNullable(blueprintId);
113 this.inputs = inputs;
114 this.tenant = tenant;
115 this.reinstall_list = (reinstallList == null) ? new LinkedList<String>() : reinstallList;
116 this.skip_install = skipInstall;
117 this.skip_uninstall = skipUninstall;
118 this.skip_reinstall = skipReinstall;
120 this.ignore_failure = ignoreFailure;
121 this.install_first = installFirst;
124 public String getBlueprintName() {
125 return this.blueprintName;
128 public Map<String, Object> getInputs() {
132 public String getTenant() {
136 public Optional<Integer> getBlueprintVersion() {
137 return blueprintVersion;
140 public String getTag() {
144 public String getComponent() {
148 public Optional<String> getBlueprintId() {
152 public Collection<String> getReinstall_list() {
153 return reinstall_list;
156 public boolean isSkip_install() {
160 public boolean isSkip_uninstall() {
161 return skip_uninstall;
164 public boolean isSkip_reinstall() {
165 return skip_reinstall;
168 public boolean isForce() {
172 public boolean isIgnore_failure() {
173 return ignore_failure;
176 public boolean isInstall_first() {
177 return install_first;