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.ArrayList;
25 import java.util.Collection;
26 import java.util.LinkedList;
28 import java.util.Optional;
30 import com.fasterxml.jackson.annotation.JsonCreator;
31 import com.fasterxml.jackson.annotation.JsonProperty;
34 * Model for message POST-ed to controller to create a Deployment via the
35 * Deployment Handler API:
39 "serviceTypeId" : "serviceTypeId",
40 "type" : "install/update",
43 "input1" : "parameter1"
44 "input2" : "parameter2"
46 "inputn" : "parametern"
51 * THIS OBJECT INCLUDES THE DEPLOYMENTID CREATED BY THE USER!
53 public class DeploymentRequestObject {
55 /** Unique deployment identifier assigned by the API client. */
56 private final String deploymentId;
58 /** type of deployment request */
59 private final String method;
62 * The service type identifier (a unique ID assigned by DCAE inventory) for the
63 * service to be deployed.
65 private final String serviceTypeId;
67 /** The cloudify tenant name for the deployment */
68 private final String tenant;
70 * Object containing inputs needed by the service blueprint to create an
71 * instance of the service. Content of the object depends on the service being
74 private final Map<String, Object> inputs;
76 private final Collection<String> reinstall_list;
78 private final boolean skip_install;
80 private final boolean skip_uninstall;
82 private final boolean skip_reinstall;
84 private final boolean force;
86 private final boolean ignore_failure;
88 private final boolean install_first;
91 public DeploymentRequestObject(@JsonProperty("deploymentId") String deploymentId,
92 @JsonProperty("serviceTypeId") String serviceTypeId, @JsonProperty("inputs") Map<String, Object> inputs,
93 @JsonProperty("tenant") String tenant, @JsonProperty("method") String method,
94 @JsonProperty("reinstall_list") Collection<String> reinstallList,
95 @JsonProperty("skip_install") boolean skipInstall,
96 @JsonProperty("skip_uninstall") boolean skipUninstall,
97 @JsonProperty("skip_reinstall") boolean skipReinstall,
98 @JsonProperty("force") boolean force,
99 @JsonProperty("ignore_failure") boolean ignoreFailure,
100 @JsonProperty("install_first") boolean installFirst) {
101 this.deploymentId = deploymentId;
102 this.serviceTypeId = serviceTypeId;
103 this.inputs = inputs;
104 this.tenant = tenant;
105 this.method = method;
106 this.reinstall_list = (reinstallList == null) ? new LinkedList<String>() : reinstallList;
107 this.skip_install = skipInstall;
108 this.skip_uninstall = skipUninstall;
109 this.skip_reinstall = skipReinstall;
111 this.ignore_failure = ignoreFailure;
112 this.install_first = installFirst;
115 public DeploymentRequestObject(String deploymentId, String serviceTypeId, String method,
116 Map<String, Object> inputs, String tenant) {
118 this.deploymentId = deploymentId;
119 this.method = method;
120 this.serviceTypeId = serviceTypeId;
121 this.tenant = tenant;
122 this.inputs = inputs;
123 this.reinstall_list = null;
124 this.skip_install = true;
125 this.skip_uninstall = true;
126 this.skip_reinstall = true;
128 this.ignore_failure = true;
129 this.install_first = false;
132 public String getDeploymentId() {
133 return this.deploymentId;
136 public String getServiceTypeId() {
137 return this.serviceTypeId;
140 public Map<String, Object> getInputs() {
144 public String getTenant() {
148 public String getMethod() {
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;