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=========================================================
19 package org.onap.so.multicloudsimulator.beans;
21 import com.fasterxml.jackson.databind.JsonNode;
22 import org.springframework.boot.context.properties.ConfigurationProperties;
23 import org.springframework.context.annotation.PropertySource;
24 import org.springframework.core.io.ClassPathResource;
25 import org.springframework.stereotype.Component;
26 import java.io.IOException;
27 import java.io.InputStream;
30 @PropertySource(value = "data/InstanceNameOutput.json")
31 @ConfigurationProperties
32 public class InstanceNameOutput {
33 private String template_type;
34 private String workload_id;
35 private String workload_status;
36 public JsonNode workload_status_reason;
38 public String getTemplate_type() {
42 public void setTemplate_type(final String template_type) {
43 this.template_type = template_type;
46 public String getWorkload_id() {
50 public void setWorkload_id(final String workload_id) {
51 this.workload_id = workload_id;
54 public String getWorkload_status() {
55 return workload_status;
58 public void setWorkload_status(final String workload_status) {
59 this.workload_status = workload_status;
62 public JsonNode getWorkload_status_reason() {
63 return workload_status_reason;
66 public void setWorkload_status_reason(final JsonNode workload_status_reason) {
67 this.workload_status_reason = workload_status_reason;
70 public final static InputStream getFile(final String file) throws IOException {
71 return new ClassPathResource(file).getInputStream();
74 public final static InputStream getInstanceName() throws Exception, IOException {
75 return getFile("data/InstanceNameOutput.json");