From f67adad42f2c857ff76b52df39f0beb5c2cabee4 Mon Sep 17 00:00:00 2001 From: Niranjana Date: Thu, 3 Feb 2022 04:50:38 +0000 Subject: [DCAEGEN2] Calculate slice utilization data Issue-ID: DCAEGEN2-2942 Signed-off-by: Niranjana Change-Id: Id16d2a36cf964b15495531a54094cad96471bdcb --- .../slice/analysis/ms/models/AggregatedConfig.java | 39 ++ .../slice/analysis/ms/models/Configuration.java | 613 +++++++++++---------- .../analysis/ms/models/SliceConfigDetails.java | 36 ++ .../analysis/ms/models/SliceConfigRequest.java | 42 ++ .../analysis/ms/models/SliceConfigResponse.java | 38 ++ .../slice/analysis/ms/models/aai/Relationship.java | 50 ++ .../analysis/ms/models/aai/RelationshipList.java | 38 ++ .../analysis/ms/models/aai/ServiceInstance.java | 55 ++ 8 files changed, 628 insertions(+), 283 deletions(-) create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/AggregatedConfig.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigDetails.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigRequest.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigResponse.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/Relationship.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/RelationshipList.java create mode 100644 components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/ServiceInstance.java (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models') diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/AggregatedConfig.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/AggregatedConfig.java new file mode 100644 index 00000000..b754f641 --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/AggregatedConfig.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * AggregatedConfig contains slice utilization data + */ +@Data +@NoArgsConstructor +public class AggregatedConfig { + + Integer dLThptPerSlice; + + Integer uLThptPerSlice; + + Integer maxNumberOfConns; +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java index 60f52f0f..2f3f6c2a 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * slice-analysis-ms * ================================================================================ - * Copyright (C) 2020-2021 Wipro Limited. + * Copyright (C) 2020-2022 Wipro Limited. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,11 @@ package org.onap.slice.analysis.ms.models; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + import java.lang.reflect.Type; import java.util.List; import java.util.Map; @@ -29,290 +34,332 @@ import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; - /** * Model class for the application Configuration */ public class Configuration { - private static Logger log = LoggerFactory.getLogger(Configuration.class); - - private static Configuration instance = null; - private String pgHost; - private int pgPort; - private String pgUsername; - private String pgPassword; - private List dmaapServers; - private String configDbService; - private String cpsUrl; - private String aaiUrl; - private Boolean configDbEnabled; - private String cg; - private String cid; - private int pollingInterval; - private int pollingTimeout; - private String aafUsername; - private String aafPassword; - private Map streamsSubscribes; - private Map streamsPublishes; - private int samples; - private int minPercentageChange; - private long initialDelaySeconds; - - /** - * Check if topic is secure. - */ - public boolean isSecured() { - return (aafUsername != null); - - } - - public String getAafUsername() { - return aafUsername; - } - - public void setAafUsername(String aafUsername) { - this.aafUsername = aafUsername; - } - - public String getAafPassword() { - return aafPassword; - } - - public void setAafPassword(String aafPassword) { - this.aafPassword = aafPassword; - } - - public Map getStreamsSubscribes() { - return streamsSubscribes; - } - - public void setStreamsSubscribes(Map streamsSubscribes) { - this.streamsSubscribes = streamsSubscribes; - } - - public Map getStreamsPublishes() { - return streamsPublishes; - } - - public void setStreamsPublishes(Map streamsPublishes) { - this.streamsPublishes = streamsPublishes; - } - - protected Configuration() { - - } - - /** - * Get instance of class. - */ - public static Configuration getInstance() { - if (instance == null) { - instance = new Configuration(); - } - return instance; - } - - public String getCg() { - return cg; - } - - public void setCg(String cg) { - this.cg = cg; - } - - public String getCid() { - return cid; - } - - public void setCid(String cid) { - this.cid = cid; - } - - public int getPollingInterval() { - return pollingInterval; - } - - public void setPollingInterval(int pollingInterval) { - this.pollingInterval = pollingInterval; - } - - public int getPollingTimeout() { - return pollingTimeout; - } - - public void setPollingTimeout(int pollingTimeout) { - this.pollingTimeout = pollingTimeout; - } - - public String getPgHost() { - return pgHost; - } - - public void setPgHost(String pgHost) { - this.pgHost = pgHost; - } - - public int getPgPort() { - return pgPort; - } - - public void setPgPort(int pgPort) { - this.pgPort = pgPort; - } - - public String getPgUsername() { - return pgUsername; - } - - public void setPgUsername(String pgUsername) { - this.pgUsername = pgUsername; - } - - public String getPgPassword() { - return pgPassword; - } - - public void setPgPassword(String pgPassword) { - this.pgPassword = pgPassword; - } - - public List getDmaapServers() { - return dmaapServers; - } - - public void setDmaapServers(List dmaapServers) { - this.dmaapServers = dmaapServers; - } - - public String getConfigDbService() { - return configDbService; - } - - public void setConfigDbService(String configDbService) { - this.configDbService = configDbService; - } - - public String getCpsUrl() { - return cpsUrl; - } - - public void setCpsUrl(String cpsUrl) { - this.cpsUrl = cpsUrl; - } - - public String getAaiUrl() { - return aaiUrl; - } - - public void setAaiUrl(String aaiUrl) { - this.aaiUrl = aaiUrl; - } - - public Boolean getConfigDbEnabled() { - return configDbEnabled; - } - - public void setConfigDbEnabled(Boolean configDbEnabled) { - this.configDbEnabled = configDbEnabled; - } - - public int getSamples() { - return samples; - } - - public void setSamples(int samples) { - this.samples = samples; - } - - public int getMinPercentageChange() { - return minPercentageChange; - } - - public void setMinPercentageChange(int minPercentageChange) { - this.minPercentageChange = minPercentageChange; - } - - public long getInitialDelaySeconds() { - return initialDelaySeconds; - } - - public void setInitialDelaySeconds(long initialDelaySeconds) { - this.initialDelaySeconds = initialDelaySeconds; - } - - @Override - public String toString() { - return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + ", pgPassword=" - + pgPassword + ", dmaapServers=" + dmaapServers + ", configDbService=" + configDbService + ", cpsUrl=" - + cpsUrl + ", aaiUrl=" + aaiUrl + ", configDbEnabled=" + configDbEnabled + ", cg=" + cg + ", cid=" + cid + ", pollingInterval=" + pollingInterval + ", pollingTimeout=" - + pollingTimeout + ", aafUsername=" + aafUsername + ", aafPassword=" + aafPassword - + ", streamsSubscribes=" + streamsSubscribes + ", streamsPublishes=" + streamsPublishes + ", samples=" - + samples + ", minPercentageChange=" + minPercentageChange + ", initialDelaySeconds=" - + initialDelaySeconds + "]"; - } - - /** - * updates application configuration. - */ - public void updateConfigurationFromJsonObject(JsonObject jsonObject) { - - log.info("Updating configuration from CBS"); - - Type mapType = new TypeToken>() { - }.getType(); - - JsonObject subscribes = jsonObject.getAsJsonObject("streams_subscribes"); - streamsSubscribes = new Gson().fromJson(subscribes, mapType); - - JsonObject publishes = jsonObject.getAsJsonObject("streams_publishes"); - streamsPublishes = new Gson().fromJson(publishes, mapType); - - pgPort = jsonObject.get("postgres.port").getAsInt(); - pollingInterval = jsonObject.get("sliceanalysisms.pollingInterval").getAsInt(); - pgPassword = jsonObject.get("postgres.password").getAsString(); - pgUsername = jsonObject.get("postgres.username").getAsString(); - pgHost = jsonObject.get("postgres.host").getAsString(); - - JsonArray servers = jsonObject.getAsJsonArray("sliceanalysisms.dmaap.server"); - Type listType = new TypeToken>() { - }.getType(); - dmaapServers = new Gson().fromJson(servers, listType); - - cg = jsonObject.get("sliceanalysisms.cg").getAsString(); - cid = jsonObject.get("sliceanalysisms.cid").getAsString(); - configDbService = jsonObject.get("sliceanalysisms.configDb.service").getAsString(); - configDbEnabled = jsonObject.get("sliceanalysisms.configDbEnabled").getAsBoolean(); - - pollingTimeout = jsonObject.get("sliceanalysisms.pollingTimeout").getAsInt(); - samples = jsonObject.get("sliceanalysisms.samples").getAsInt(); - minPercentageChange = jsonObject.get("sliceanalysisms.minPercentageChange").getAsInt(); - initialDelaySeconds = jsonObject.get("sliceanalysisms.initialDelaySeconds").getAsLong(); - - if (Objects.isNull(jsonObject.get("aafUsername"))) { - aafUsername = null; - } else { - aafUsername = jsonObject.get("aafUsername").getAsString(); - } - if (Objects.isNull(jsonObject.get("aafPassword"))) { - aafPassword = null; - } else { - aafPassword = jsonObject.get("aafPassword").getAsString(); - } - if (Objects.isNull(jsonObject.get("sliceanalysisms.aai.url"))) { - aaiUrl = null; - } else { - aaiUrl = jsonObject.get("sliceanalysisms.aai.url").getAsString(); - } - if (Objects.isNull(jsonObject.get("sliceanalysisms.cps.url"))) { - cpsUrl = null; - } else { - cpsUrl = jsonObject.get("sliceanalysisms.cps.url").getAsString(); - } - log.info("configuration from CBS {}", this); - } + private static Logger log = LoggerFactory.getLogger(Configuration.class); + + private static Configuration instance = null; + private String pgHost; + private int pgPort; + private String pgUsername; + private String pgPassword; + private List dmaapServers; + private String configDbService; + private String cpsUrl; + private String aaiUrl; + private Boolean configDbEnabled; + private String cg; + private String cid; + private int pollingInterval; + private int pollingTimeout; + private String aafUsername; + private String aafPassword; + private Map streamsSubscribes; + private Map streamsPublishes; + private int samples; + private int minPercentageChange; + private long initialDelaySeconds; + private String rannfnssiDetailsTemplateId; + private String desUrl; + private int pmDataDurationInWeeks; + + /** + * Check if topic is secure. + */ + public boolean isSecured() { + return (aafUsername != null); + + } + + public String getAafUsername() { + return aafUsername; + } + + public void setAafUsername(String aafUsername) { + this.aafUsername = aafUsername; + } + + public String getAafPassword() { + return aafPassword; + } + + public void setAafPassword(String aafPassword) { + this.aafPassword = aafPassword; + } + + public Map getStreamsSubscribes() { + return streamsSubscribes; + } + + public void setStreamsSubscribes(Map streamsSubscribes) { + this.streamsSubscribes = streamsSubscribes; + } + + public Map getStreamsPublishes() { + return streamsPublishes; + } + + public void setStreamsPublishes(Map streamsPublishes) { + this.streamsPublishes = streamsPublishes; + } + + protected Configuration() { + + } + + /** + * Get instance of class. + */ + public static Configuration getInstance() { + if (instance == null) { + instance = new Configuration(); + } + return instance; + } + + public String getCg() { + return cg; + } + + public void setCg(String cg) { + this.cg = cg; + } + + public String getCid() { + return cid; + } + + public void setCid(String cid) { + this.cid = cid; + } + + public int getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(int pollingInterval) { + this.pollingInterval = pollingInterval; + } + + public int getPollingTimeout() { + return pollingTimeout; + } + + public void setPollingTimeout(int pollingTimeout) { + this.pollingTimeout = pollingTimeout; + } + + public String getPgHost() { + return pgHost; + } + + public void setPgHost(String pgHost) { + this.pgHost = pgHost; + } + + public int getPgPort() { + return pgPort; + } + + public void setPgPort(int pgPort) { + this.pgPort = pgPort; + } + + public String getPgUsername() { + return pgUsername; + } + + public void setPgUsername(String pgUsername) { + this.pgUsername = pgUsername; + } + + public String getPgPassword() { + return pgPassword; + } + + public void setPgPassword(String pgPassword) { + this.pgPassword = pgPassword; + } + + public List getDmaapServers() { + return dmaapServers; + } + + public void setDmaapServers(List dmaapServers) { + this.dmaapServers = dmaapServers; + } + + public String getConfigDbService() { + return configDbService; + } + + public void setConfigDbService(String configDbService) { + this.configDbService = configDbService; + } + + public String getCpsUrl() { + return cpsUrl; + } + + public void setCpsUrl(String cpsUrl) { + this.cpsUrl = cpsUrl; + } + + public String getAaiUrl() { + return aaiUrl; + } + + public void setAaiUrl(String aaiUrl) { + this.aaiUrl = aaiUrl; + } + + public Boolean getConfigDbEnabled() { + return configDbEnabled; + } + + public void setConfigDbEnabled(Boolean configDbEnabled) { + this.configDbEnabled = configDbEnabled; + } + + public int getSamples() { + return samples; + } + + public void setSamples(int samples) { + this.samples = samples; + } + + public int getMinPercentageChange() { + return minPercentageChange; + } + + public void setMinPercentageChange(int minPercentageChange) { + this.minPercentageChange = minPercentageChange; + } + + public long getInitialDelaySeconds() { + return initialDelaySeconds; + } + + public void setInitialDelaySeconds(long initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + } + + /** + * Get RannfnssiDetails TemplateId from Configuration + */ + public String getRannfnssiDetailsTemplateId() { + return rannfnssiDetailsTemplateId; + } + + /** + * Set RannfnssiDetails TemplateId + */ + public void setRannfnssiDetailsTemplateId(String rannfnssiDetailsTemplateId) { + this.rannfnssiDetailsTemplateId = rannfnssiDetailsTemplateId; + } + + /** + * Get Data Extraction Service Url + */ + public String getDesUrl() { + return desUrl; + } + + /** + * Set Data Extraction Service Url + */ + public void setDesUrl(String desUrl) { + this.desUrl = desUrl; + } + + /** + * Get duration for which PM data is to be fetched from DES + */ + public int getPmDataDurationInWeeks() { + return pmDataDurationInWeeks; + } + + /** + * Set duration for which PM data is to be fetched from DES + */ + public void setPmDataDurationInWeeks(int pmDataDurationInWeeks) { + this.pmDataDurationInWeeks = pmDataDurationInWeeks; + } + + @Override + public String toString() { + return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + ", pgPassword=" + + pgPassword + ", dmaapServers=" + dmaapServers + ", configDbService=" + configDbService + ", cpsUrl=" + + cpsUrl + ", aaiUrl=" + aaiUrl + ", configDbEnabled=" + configDbEnabled + ", cg=" + cg + ", cid=" + cid + + ", pollingInterval=" + pollingInterval + ", pollingTimeout=" + pollingTimeout + ", aafUsername=" + + aafUsername + ", aafPassword=" + aafPassword + ", streamsSubscribes=" + streamsSubscribes + + ", streamsPublishes=" + streamsPublishes + ", samples=" + samples + ", minPercentageChange=" + + minPercentageChange + ", initialDelaySeconds=" + initialDelaySeconds + ", rannfnssiDetailsTemplateId=" + + rannfnssiDetailsTemplateId + ", desUrl=" + desUrl + ", pmDataDurationInWeeks=" + pmDataDurationInWeeks + + "]"; + } + + /** + * updates application configuration. + */ + public void updateConfigurationFromJsonObject(JsonObject jsonObject) { + + log.info("Updating configuration from CBS"); + + Type mapType = new TypeToken>() {}.getType(); + + JsonObject subscribes = jsonObject.getAsJsonObject("streams_subscribes"); + streamsSubscribes = new Gson().fromJson(subscribes, mapType); + + JsonObject publishes = jsonObject.getAsJsonObject("streams_publishes"); + streamsPublishes = new Gson().fromJson(publishes, mapType); + + pgPort = jsonObject.get("postgres.port").getAsInt(); + pollingInterval = jsonObject.get("sliceanalysisms.pollingInterval").getAsInt(); + pgPassword = jsonObject.get("postgres.password").getAsString(); + pgUsername = jsonObject.get("postgres.username").getAsString(); + pgHost = jsonObject.get("postgres.host").getAsString(); + + JsonArray servers = jsonObject.getAsJsonArray("sliceanalysisms.dmaap.server"); + Type listType = new TypeToken>() {}.getType(); + dmaapServers = new Gson().fromJson(servers, listType); + + cg = jsonObject.get("sliceanalysisms.cg").getAsString(); + cid = jsonObject.get("sliceanalysisms.cid").getAsString(); + configDbService = jsonObject.get("sliceanalysisms.configDb.service").getAsString(); + configDbEnabled = jsonObject.get("sliceanalysisms.configDbEnabled").getAsBoolean(); + + pollingTimeout = jsonObject.get("sliceanalysisms.pollingTimeout").getAsInt(); + samples = jsonObject.get("sliceanalysisms.samples").getAsInt(); + minPercentageChange = jsonObject.get("sliceanalysisms.minPercentageChange").getAsInt(); + initialDelaySeconds = jsonObject.get("sliceanalysisms.initialDelaySeconds").getAsLong(); + rannfnssiDetailsTemplateId = jsonObject.get("sliceanalysisms.rannfnssiDetailsTemplateId").getAsString(); + desUrl = jsonObject.get("sliceanalysisms.desUrl").getAsString(); + pmDataDurationInWeeks = jsonObject.get("sliceanalysisms.pmDataDurationInWeeks").getAsInt(); + + if (Objects.isNull(jsonObject.get("aafUsername"))) { + aafUsername = null; + } else { + aafUsername = jsonObject.get("aafUsername").getAsString(); + } + if (Objects.isNull(jsonObject.get("aafPassword"))) { + aafPassword = null; + } else { + aafPassword = jsonObject.get("aafPassword").getAsString(); + } + if (Objects.isNull(jsonObject.get("sliceanalysisms.aai.url"))) { + aaiUrl = null; + } else { + aaiUrl = jsonObject.get("sliceanalysisms.aai.url").getAsString(); + } + if (Objects.isNull(jsonObject.get("sliceanalysisms.cps.url"))) { + cpsUrl = null; + } else { + cpsUrl = jsonObject.get("sliceanalysisms.cps.url").getAsString(); + } + log.info("configuration from CBS {}", this); + } } - diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigDetails.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigDetails.java new file mode 100644 index 00000000..5f8b7434 --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigDetails.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * SliceConfigDetails contains slice utilization data for requested slice + */ +@Data +@NoArgsConstructor +public class SliceConfigDetails { + + String sliceIdentifiers; + AggregatedConfig aggregatedConfig; +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigRequest.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigRequest.java new file mode 100644 index 00000000..aefbdd38 --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigRequest.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models; + +import java.util.List; + +import javax.validation.constraints.NotEmpty; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Request body to get slice utilization data + */ +@Data +@NoArgsConstructor +public class SliceConfigRequest { + + @NotEmpty(message = "Slice Identifier missing") + List sliceIdentifiers; + @NotEmpty(message = "Config Param missing") + List configParams; +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigResponse.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigResponse.java new file mode 100644 index 00000000..18d28ca2 --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/SliceConfigResponse.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models; + +import java.util.List; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * SliceConfigResponse contains slice utilization data for requested slices + */ +@Data +@NoArgsConstructor +public class SliceConfigResponse { + + List sliceConfigDetails; + +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/Relationship.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/Relationship.java new file mode 100644 index 00000000..f4acc08b --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/Relationship.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models.aai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; +import java.util.Map; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Model for receiving Relationship data of a service from AAI + */ +@Data +@NoArgsConstructor +public class Relationship { + + @JsonProperty("related-to") + private String relatedTo; + @JsonProperty("relationship-label") + private String relationshipLabel; + @JsonProperty("related-link") + private String relatedLink; + @JsonProperty("relationship-data") + private List> relationshipData; + @JsonProperty("related-to-property") + private List> relatedToProperty; + +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/RelationshipList.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/RelationshipList.java new file mode 100644 index 00000000..1cda2ae5 --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/RelationshipList.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models.aai; + +import java.util.List; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Model for receiving RelationshipList data of a service from AAI + */ +@Data +@NoArgsConstructor +public class RelationshipList { + + List relationship; + +} diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/ServiceInstance.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/ServiceInstance.java new file mode 100644 index 00000000..ecb2c4cd --- /dev/null +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/aai/ServiceInstance.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * ============LICENSE_START======================================================= + * slice-analysis-ms + * ================================================================================ + * Copyright (C) 2022 Wipro Limited. + * ============================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +package org.onap.slice.analysis.ms.models.aai; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Model for receiving ServiceInstance data from AAI + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +@NoArgsConstructor +public class ServiceInstance { + + @JsonProperty("service-instance-id") + private String serviceInstanceId; + @JsonProperty("service-instance-name") + private String serviceInstanceName; + @JsonProperty("service-type;") + private String serviceType; + @JsonProperty("service-role") + private String serviceRole; + @JsonProperty("environment-context") + private String environmentContext; + @JsonProperty("workload-context") + private String workloadContext; + @JsonProperty("orchestration-status") + private String orchestrationStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + +} -- cgit 1.2.3-korg