2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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=========================================================
21 package org.onap.so.adapters.valet.beans;
23 import java.io.Serializable;
24 import java.util.HashMap;
26 import java.util.Objects;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.woorea.openstack.heat.model.CreateStackParam;
32 * This class represents the heat request as sent to OpenStack as defined in the
33 * Valet Placement Operations API
35 public class HeatRequest implements Serializable {
36 private static final long serialVersionUID = 768026109321305392L;
37 @JsonProperty("stack_name")
38 private String stackName;
39 @JsonProperty("disable_rollback")
40 private Boolean disableRollback;
41 @JsonProperty("timeout_mins")
42 private Integer timeoutMins;
43 @JsonProperty("template")
44 private String template;
45 @JsonProperty("environment")
46 private String environment;
47 @JsonProperty("files")
48 private Map<String, Object> files = new HashMap<String, Object>();
49 @JsonProperty("parameters")
50 private Map<String, Object> parameters = new HashMap<String, Object>();
52 public HeatRequest(String stackName, boolean disableRollback, int timeoutMins, String template, String environment, Map<String, Object> files, Map<String, Object> parameters) {
54 this.stackName = stackName;
55 this.disableRollback = disableRollback;
56 this.timeoutMins = timeoutMins;
57 this.template = template;
58 this.environment = environment;
60 this.parameters = parameters;
63 public String getStackName() {
64 return this.stackName;
66 public void setStackName(String stackName) {
67 this.stackName = stackName;
69 public Boolean getDisableRollback() {
70 return this.disableRollback;
72 public void setDisableRollback(Boolean disableRollback) {
73 this.disableRollback = disableRollback;
75 public Integer getTimeoutMins() {
76 return this.timeoutMins;
78 public void setTimeoutMins(Integer timeoutMins) {
79 this.timeoutMins = timeoutMins;
81 public String getTemplate() {
84 public void setTemplate(String template) {
85 this.template = template;
87 public String getEnvironment() {
88 return this.environment;
90 public void setEnvironment(String environment) {
91 this.environment = environment;
93 public Map<String, Object> getFiles() {
96 public void setFiles(Map<String, Object> files) {
99 public Map<String, Object> getParameters() {
100 return this.parameters;
102 public void setParameters(Map<String, Object> parameters) {
103 this.parameters = parameters;
106 public int hashCode() {
107 return Objects.hash(stackName, disableRollback, timeoutMins, template, environment, files, parameters);
110 public boolean equals(Object o) {
113 if (!(o instanceof HeatRequest)) {
116 HeatRequest hr = (HeatRequest) o;
117 return Objects.equals(stackName, hr.stackName)
118 && Objects.equals(disableRollback, hr.disableRollback)
119 && Objects.equals(timeoutMins, hr.timeoutMins)
120 && Objects.equals(template, hr.template)
121 && Objects.equals(environment, hr.environment)
122 && Objects.equals(files, hr.files)
123 && Objects.equals(parameters, hr.parameters);