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
9 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
18 package org.onap.so.multicloudsimulator.beans;
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;
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;
40 public JsonNode getWorkload_status_reason() {
41 return workload_status_reason;
44 public void setWorkload_status_reason(final JsonNode workload_status_reason) {
45 this.workload_status_reason = workload_status_reason;
48 public String getTemplate_type() {
52 public void setTemplate_type(final String template_type) {
53 this.template_type = template_type;
56 public String getWorkload_id() {
60 public void setWorkload_id(final String workload_id) {
61 this.workload_id = workload_id;
64 public String getWorkload_status() {
65 return workload_status;
68 public void setWorkload_status(final String workload_status) {
69 this.workload_status = workload_status;
72 public static InputStream getFile(final String file) throws IOException {
73 return new ClassPathResource(file).getInputStream();
76 public static InputStream getInstance() throws Exception, IOException {
77 return getFile("data/InstanceOutput.json");