Added CSIT for Macroflow with HEAT
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / multicloud-simulator / src / main / java / org / onap / so / multicloudsimulator / beans / InstanceOutput.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright 2021 Huawei Technologies Co., Ltd.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  */
18 package org.onap.so.multicloudsimulator.beans;
19
20 import com.fasterxml.jackson.databind.JsonNode;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23 import org.springframework.boot.context.properties.ConfigurationProperties;
24 import org.springframework.context.annotation.PropertySource;
25 import org.springframework.core.io.ClassPathResource;
26 import org.springframework.stereotype.Component;
27 import java.io.IOException;
28 import java.io.InputStream;
29
30 @Component
31 @PropertySource(value = "data/InstanceOutput.json")
32 @ConfigurationProperties
33 public class InstanceOutput {
34     private static final Logger LOGGER = LoggerFactory.getLogger(InstanceOutput.class);
35     private String template_type;
36     private String workload_id;
37     private String workload_status;
38     public JsonNode workload_status_reason;
39
40     public JsonNode getWorkload_status_reason() {
41         return workload_status_reason;
42     }
43
44     public void setWorkload_status_reason(final JsonNode workload_status_reason) {
45         this.workload_status_reason = workload_status_reason;
46     }
47
48     public String getTemplate_type() {
49         return template_type;
50     }
51
52     public void setTemplate_type(final String template_type) {
53         this.template_type = template_type;
54     }
55
56     public String getWorkload_id() {
57         return workload_id;
58     }
59
60     public void setWorkload_id(final String workload_id) {
61         this.workload_id = workload_id;
62     }
63
64     public String getWorkload_status() {
65         return workload_status;
66     }
67
68     public void setWorkload_status(final String workload_status) {
69         this.workload_status = workload_status;
70     }
71
72     public static InputStream getFile(final String file) throws IOException {
73         return new ClassPathResource(file).getInputStream();
74     }
75
76     public static InputStream getInstance() throws Exception, IOException {
77         return getFile("data/InstanceOutput.json");
78     }
79 }