From 5bd93f34b7221c8c141785574082253fcb61d276 Mon Sep 17 00:00:00 2001 From: Joseph Chou Date: Wed, 6 Sep 2017 16:54:33 -0400 Subject: ONAP code for AAI, consolidate name and get query Adding AAI GET query feature to support ONAP project (1 commit) Issue-ID: POLICY-103 Change-Id: I0a55f41c3edd7a0bc0562ae4e12a19f262a50d74 Signed-off-by: Joseph Chou --- controlloop/common/model-impl/aai/pom.xml | 6 + .../org/onap/policy/aai/AAIGETResponseWrapper.java | 38 ++++ .../org/onap/policy/aai/AAIGETVnfResponse.java | 67 +++++++ .../org/onap/policy/aai/AAIGETVserverResponse.java | 65 +++++++ .../main/java/org/onap/policy/aai/AAIManager.java | 201 +++++++++++++++++++++ .../java/org/onap/policy/aai/AAINQCloudRegion.java | 51 ++++++ .../org/onap/policy/aai/AAINQExtraProperties.java | 42 +++++ .../org/onap/policy/aai/AAINQExtraProperty.java | 48 +++++ .../java/org/onap/policy/aai/AAINQGenericVNF.java | 85 +++++++++ .../org/onap/policy/aai/AAINQInstanceFilters.java | 43 +++++ .../policy/aai/AAINQInventoryResponseItem.java | 64 +++++++ .../policy/aai/AAINQInventoryResponseItems.java | 42 +++++ .../java/org/onap/policy/aai/AAINQNamedQuery.java | 41 +++++ .../org/onap/policy/aai/AAINQQueryParameters.java | 40 ++++ .../java/org/onap/policy/aai/AAINQRequest.java | 42 +++++ .../java/org/onap/policy/aai/AAINQResponse.java | 43 +++++ .../org/onap/policy/aai/AAINQResponseWrapper.java | 40 ++++ .../org/onap/policy/aai/AAINQServiceInstance.java | 55 ++++++ .../main/java/org/onap/policy/aai/AAINQTenant.java | 45 +++++ .../java/org/onap/policy/aai/AAINQVServer.java | 61 +++++++ .../java/org/onap/policy/aai/AAINQVfModule.java | 69 +++++++ .../org/onap/policy/aai/RelatedToProperty.java | 37 ++++ .../java/org/onap/policy/aai/Relationship.java | 40 ++++ .../java/org/onap/policy/aai/RelationshipData.java | 35 ++++ .../org/onap/policy/aai/RelationshipDataItem.java | 38 ++++ .../java/org/onap/policy/aai/RelationshipList.java | 18 +- .../org/onap/policy/aai/AAIGETVnfResponseTest.java | 89 +++++++++ .../onap/policy/aai/AAIGETVserverResponseTest.java | 88 +++++++++ 28 files changed, 1521 insertions(+), 12 deletions(-) create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponseWrapper.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java create mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java create mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java (limited to 'controlloop/common/model-impl/aai') diff --git a/controlloop/common/model-impl/aai/pom.xml b/controlloop/common/model-impl/aai/pom.xml index da412a138..dcf6f3741 100644 --- a/controlloop/common/model-impl/aai/pom.xml +++ b/controlloop/common/model-impl/aai/pom.xml @@ -22,5 +22,11 @@ rest 1.1.0-SNAPSHOT + + junit + junit + 4.12 + test + diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponseWrapper.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponseWrapper.java new file mode 100644 index 000000000..57140cebe --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponseWrapper.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.UUID; +import org.onap.policy.aai.AAIGETResponse; + +public class AAIGETResponseWrapper implements Serializable { + public UUID requestID; + public AAIGETResponse aairesponse; + + public AAIGETResponseWrapper() { + + } + + public AAIGETResponseWrapper(UUID requestID, AAIGETResponse aairesponse){ + this.requestID = requestID; + this.aairesponse = aairesponse; + } +} \ No newline at end of file diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java new file mode 100644 index 000000000..24361c7f6 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAIGETVnfResponse implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -6247505944905898870L; + + @SerializedName("vnf-id") + public String vnfID; + + @SerializedName("vnf-name") + public String vnfName; + + @SerializedName("vnf-type") + public String vnfType; + + @SerializedName("service-id") + public String serviceId; + + @SerializedName("orchestration-status") + public String orchestrationStatus; + + @SerializedName("in-maint") + public String inMaint; + + @SerializedName("is-closed-loop-disabled") + public String isClosedLoopDisabled; + + @SerializedName("resource-version") + public String resourceVersion; + + @SerializedName("model-invariant-id") + public String modelInvariantId; + + @SerializedName("relationship-list") + public RelationshipList relationshipList; + + public AAIGETVnfResponse() { + } + +} \ No newline at end of file diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java new file mode 100644 index 000000000..b318f72ef --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class AAIGETVserverResponse implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -6247505944905898870L; + + @SerializedName("vserver-id") + public String vserverID; + + @SerializedName("vserver-name") + public String vserverName; + + @SerializedName("vserver-name2") + public String vserverName2; + + @SerializedName("vserver-selflink") + public String vserverSelflink; + + @SerializedName("in-maint") + public String inMaint; + + @SerializedName("is-closed-loop-disabled") + public String isClosedLoopDisabled; + + @SerializedName("resource-version") + public String resourceVersion; + + @SerializedName("model-invariant-id") + public String modelInvariantId; + + public RelationshipList relationshipList; + + public AAIGETVserverResponse() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java new file mode 100644 index 000000000..51954ac6f --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java @@ -0,0 +1,201 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.onap.policy.aai.AAIGETVserverResponse; +import org.onap.policy.aai.AAIGETVnfResponse; +import org.onap.policy.aai.RelatedToPropertyItem; +import org.onap.policy.aai.RelationshipDataItem; +import org.onap.policy.aai.RelationshipData; +import org.onap.policy.aai.util.Serialization; +import org.onap.policy.aai.AAINQRequest; +import org.onap.policy.aai.AAINQResponse; +import org.onap.policy.rest.RESTManager; +import org.onap.policy.rest.RESTManager.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonSyntaxException; + +public final class AAIManager { + private static final Logger logger = LoggerFactory.getLogger(AAIManager.class); + + public static AAINQResponse postQuery(String url, String username, String password, AAINQRequest request, UUID requestID) { + + Map headers = new HashMap<>(); + headers.put("X-FromAppId", "POLICY"); + headers.put("X-TransactionId", requestID.toString()); + headers.put("Accept", "application/json"); + + url = url + "/aai/search/named-query"; + + logger.debug("ESTManager.post before"); + Pair httpDetails = RESTManager.post(url, username, password, headers, "application/json", Serialization.gsonPretty.toJson(request)); + logger.debug("ESTManager.post after"); + + if (httpDetails == null) { + logger.info("AAI POST Null Response to " + url); + return null; + } + + logger.info(url); + logger.info(httpDetails.a.toString()); + logger.info(httpDetails.b); + if (httpDetails.a == 200) { + try { + AAINQResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, AAINQResponse.class); + return response; + } catch (JsonSyntaxException e) { + logger.error("postQuery threw: ", e); + } + } + + return null; + } + + public static AAIGETVserverResponse getQueryByVserverName(String urlGet, String username, String password, UUID requestID, String key) { + + Map headers = new HashMap<>(); + headers.put("X-FromAppId", "POLICY"); + headers.put("X-TransactionId", requestID.toString()); + headers.put("Accept", "application/json"); + + urlGet = urlGet + key; + + int attemptsLeft = 3; + AAIGETVserverResponse responseGet = null; + + while(attemptsLeft-- > 0){ + + Pair httpDetailsGet = RESTManager.get(urlGet, username, password, headers); + if (httpDetailsGet == null) { + logger.info("AAI GET Null Response to " + urlGet); + return null; + } + + logger.info(urlGet); + logger.info(httpDetailsGet.a.toString()); + logger.info(httpDetailsGet.b); + + if (httpDetailsGet.a == 200) { + try { + responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, AAIGETVserverResponse.class); + return responseGet; + } catch (JsonSyntaxException e) { + logger.error("postQuery threw: ", e); + } + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { Thread.currentThread().interrupt(); } + } + + return null; + } + + public static AAIGETVnfResponse getQueryByVnfID(String urlGet, String username, String password, UUID requestID, String key) { + + Map headers = new HashMap<>(); + headers.put("X-FromAppId", "POLICY"); + headers.put("X-TransactionId", requestID.toString()); + headers.put("Accept", "application/json"); + + urlGet = urlGet + key; + + int attemptsLeft = 3; + AAIGETVnfResponse responseGet = null; + + while(attemptsLeft-- > 0){ + + Pair httpDetailsGet = RESTManager.get(urlGet, username, password, headers); + if (httpDetailsGet == null) { + logger.info("AAI GET Null Response to " + urlGet); + return null; + } + + logger.info(urlGet); + logger.info(httpDetailsGet.a.toString()); + logger.info(httpDetailsGet.b); + + if (httpDetailsGet.a == 200) { + try { + responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, AAIGETVnfResponse.class); + return responseGet; + } catch (JsonSyntaxException e) { + logger.error("postQuery threw: ", e); + } + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { Thread.currentThread().interrupt(); } + + } + + return null; + } + + public static AAIGETVnfResponse getQueryByVnfName(String urlGet, String username, String password, UUID requestID, String key) { + + Map headers = new HashMap<>(); + headers.put("X-FromAppId", "POLICY"); + headers.put("X-TransactionId", requestID.toString()); + headers.put("Accept", "application/json"); + + urlGet = urlGet + key; + + int attemptsLeft = 3; + AAIGETVnfResponse responseGet = null; + + while(attemptsLeft-- > 0){ + + Pair httpDetailsGet = RESTManager.get(urlGet, username, password, headers); + if (httpDetailsGet == null) { + logger.info("AAI GET Null Response to " + urlGet); + return null; + } + + logger.info(urlGet); + logger.info(httpDetailsGet.a.toString()); + logger.info(httpDetailsGet.b); + + if (httpDetailsGet.a == 200) { + try { + responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, AAIGETVnfResponse.class); + return responseGet; + } catch (JsonSyntaxException e) { + logger.error("postQuery threw: ", e); + } + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { Thread.currentThread().interrupt(); } + + } + + return null; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java new file mode 100644 index 000000000..cbe2b9730 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQCloudRegion implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -897231529157222683L; + + @SerializedName("cloud-owner") + public String cloudOwner; + + @SerializedName("cloud-region-id") + public String cloudRegionId; + + @SerializedName("cloud-region-version") + public String cloudRegionVersion; + + @SerializedName("complex-name") + public String complexName; + + @SerializedName("resource-version") + public String resourceVersion; + + public AAINQCloudRegion() { + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java new file mode 100644 index 000000000..6f451ce8d --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class AAINQExtraProperties implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 4109625574744702319L; + + @SerializedName("extra-property") + public List extraProperty = new LinkedList(); + + public AAINQExtraProperties() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java new file mode 100644 index 000000000..4a968c5e6 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQExtraProperty implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3861240617222397736L; + + @SerializedName("property-name") + public String propertyName; + + @SerializedName("property-value") + public String propertyValue; + + public AAINQExtraProperty() { + } + + public AAINQExtraProperty(String propertyName, String propertyValue) { + this.propertyName = propertyName; + this.propertyValue = propertyValue; + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java new file mode 100644 index 000000000..beec3204d --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQGenericVNF implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 834322706248060559L; + + @SerializedName("vnf-id") + public String vnfID; + + @SerializedName("vnf-name") + public String vnfName; + + @SerializedName("vnf-name2") + public String vnfName2; + + @SerializedName("vnf-type") + public String vnfType; + + @SerializedName("service-id") + public String serviceId; + + @SerializedName("prov-status") + public String provStatus; + + @SerializedName("operational-state") + public String operationalState; + + @SerializedName("ipv4-oam-address") + public String ipv4OamAddress; + + @SerializedName("ipv4-loopback0-address") + public String ipv4Loopback0Address; + + @SerializedName("in-maint") + public Boolean inMaint; + + @SerializedName("is-closed-loop-disabled") + public Boolean isClosedLoopDisabled; + + @SerializedName("resource-version") + public String resourceVersion; + + @SerializedName("encrypted-access-flag") + public Boolean encrypedAccessFlag; + + @SerializedName("persona-model-id") + public String personaModelId; + + @SerializedName("persona-model-version") + public String personaModelVersion; + + @SerializedName("model-invariant-id") + public String modelInvariantId; + + public AAINQGenericVNF() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java new file mode 100644 index 000000000..b122279d6 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import com.google.gson.annotations.SerializedName; + +public class AAINQInstanceFilters implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8993824591338121185L; + + @SerializedName("instance-filter") + public List>> instanceFilter = new LinkedList<>(); + + public AAINQInstanceFilters() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java new file mode 100644 index 000000000..1dece7da0 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQInventoryResponseItem implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 7142072567154675183L; + + @SerializedName("model-name") + public String modelName; + + @SerializedName("vf-module") + public AAINQVfModule vfModule; + + @SerializedName("service-instance") + public AAINQServiceInstance serviceInstance; + + @SerializedName("vserver") + public AAINQVServer vserver; + + @SerializedName("tenant") + public AAINQTenant tenant; + + @SerializedName("cloud-region") + public AAINQCloudRegion cloudRegion; + + @SerializedName("generic-vnf") + public AAINQGenericVNF genericVNF; + + @SerializedName("extra-properties") + public AAINQExtraProperties extraProperties; + + @SerializedName("inventory-response-items") + public AAINQInventoryResponseItems items; + + public AAINQInventoryResponseItem() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java new file mode 100644 index 000000000..f4ee0fa3e --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class AAINQInventoryResponseItems implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 7602807659381179004L; + + @SerializedName("inventory-response-item") + public List inventoryResponseItems = new LinkedList<>(); + + public AAINQInventoryResponseItems() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java new file mode 100644 index 000000000..7ed82e1e9 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.UUID; + +import com.google.gson.annotations.SerializedName; + +public class AAINQNamedQuery implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3277980060302645333L; + + @SerializedName("named-query-uuid") + public UUID namedQueryUUID; + + public AAINQNamedQuery() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java new file mode 100644 index 000000000..eca372bf6 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQQueryParameters implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -4291227193197126982L; + + @SerializedName("named-query") + public AAINQNamedQuery namedQuery; + + public AAINQQueryParameters() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java new file mode 100644 index 000000000..91d9f1a6e --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQRequest implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3283942659786236032L; + + @SerializedName("query-parameters") + public AAINQQueryParameters queryParameters; + @SerializedName("instance-filters") + public AAINQInstanceFilters instanceFilters; + + public AAINQRequest() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java new file mode 100644 index 000000000..09f983094 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import org.onap.policy.aai.AAINQInventoryResponseItem; + +public class AAINQResponse implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8411407444051746101L; + + @SerializedName("inventory-response-item") + public List inventoryResponseItems = new LinkedList<>(); + + public AAINQResponse() { + } + +} \ No newline at end of file diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java new file mode 100644 index 000000000..7bb58eb7d --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.util.UUID; + +import org.onap.policy.aai.AAINQResponse; + +public class AAINQResponseWrapper { + + public UUID requestID; + public AAINQResponse aainqresponse; + + public AAINQResponseWrapper() { + + } + + public AAINQResponseWrapper(UUID requestID, AAINQResponse aainqresponse){ + this.requestID = requestID; + this.aainqresponse = aainqresponse; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java new file mode 100644 index 000000000..c6efac781 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQServiceInstance implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -8000944396593889586L; + + @SerializedName("service-instance-id") + public String serviceInstanceID; + + @SerializedName("service-instance-name") + public String serviceInstanceName; + + @SerializedName("persona-model-id") + public String personaModelId; + + @SerializedName("persona-model-version") + public String personaModelVersion; + + @SerializedName("service-instance-location-id") + public String serviceInstanceLocationId; + + @SerializedName("resource-version") + public String resourceVersion; + + public AAINQServiceInstance() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java new file mode 100644 index 000000000..98ea83b1f --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQTenant implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 4702784101671984364L; + + @SerializedName("tenant-id") + public String tenantId; + + @SerializedName("tenant-name") + public String tenantName; + + @SerializedName("resource-version") + public String resourceVersion; + + public AAINQTenant() { + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java new file mode 100644 index 000000000..5a9834fee --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQVServer implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -6718526692734215643L; + + @SerializedName("vserver-id") + public String vserverId; + + @SerializedName("vserver-name") + public String vserverName; + + @SerializedName("vserver-name2") + public String vserverName2; + + @SerializedName("prov-status") + public String provStatus; + + @SerializedName("vserver-selflink") + public String vserverSelflink; + + @SerializedName("in-maint") + public Boolean inMaint; + + @SerializedName("is-closed-loop-disabled") + public Boolean isClosedLoopDisabled; + + @SerializedName("resource-version") + public String resourceVersion; + + public AAINQVServer() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java new file mode 100644 index 000000000..d3249d834 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class AAINQVfModule implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8019133081429638231L; + + @SerializedName("vf-module-id") + public String vfModuleId; + + @SerializedName("vf-module-name") + public String vfModuleName; + + @SerializedName("heat-stack-id") + public String heatStackId; + + @SerializedName("orchestration-status") + public String orchestrationStatus; + + @SerializedName("is-base-vf-module") + public Boolean isBaseVfModule; + + @SerializedName("resource-version") + public String resourceVersion; + + @SerializedName("persona-model-id") + public String personaModelId; + + @SerializedName("persona-model-version") + public String personaModelVersion; + + @SerializedName("widget-model-id") + public String widgetModelId; + + @SerializedName("widget-model-version") + public String widgetModelVersion; + + @SerializedName("contrail-service-instance-fqdn") + public String contrailServiceInstanceFqdn; + + public AAINQVfModule() { + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java new file mode 100644 index 000000000..12e80d50e --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class RelatedToProperty { + + @SerializedName("related-to-property") + public List relatedTo = new LinkedList(); + + public RelatedToProperty() { + } +} + + \ No newline at end of file diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java new file mode 100644 index 000000000..8ceb067b1 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import com.google.gson.annotations.SerializedName; + +public class Relationship { + + @SerializedName("related-to") + public String relatedTo; + @SerializedName("related-link") + public String relatedLink; + + @SerializedName("relationship-data") + public RelationshipData relationshipData = new RelationshipData(); + + @SerializedName("related-to-property") + public RelatedToProperty relatedToProperty = new RelatedToProperty(); + + public Relationship() { + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java new file mode 100644 index 000000000..e5bc05599 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.util.List; +import java.util.LinkedList; + +import com.google.gson.annotations.SerializedName; + +public class RelationshipData { + + @SerializedName("relationship-data") + public List relationshipData = new LinkedList<>(); + + public RelationshipData() { + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java new file mode 100644 index 000000000..9b207ef68 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import java.util.List; +import java.util.LinkedList; + +import com.google.gson.annotations.SerializedName; + +public class RelationshipDataItem { + + @SerializedName("relationship-key") + public String relationshipKey; + @SerializedName("relationship-value") + public String relationshipValue; + + public RelationshipDataItem() { + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java index 4799733da..14f601730 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java @@ -20,22 +20,16 @@ package org.onap.policy.aai; -import java.util.List; -import java.io.Serializable; -import java.util.LinkedList; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; +import java.util.List; +import java.util.LinkedList; -public class RelationshipList implements Serializable { +public class RelationshipList { - /** - * - */ - private static final long serialVersionUID = -1769880386474240406L; - @SerializedName("relationship") - public List relationship = new LinkedList(); + @SerializedName("relationship-list") + public List relationshipList = new LinkedList<>(); public RelationshipList() { } - } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java new file mode 100644 index 000000000..3b489155c --- /dev/null +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java @@ -0,0 +1,89 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import static org.junit.Assert.*; +import java.util.List; +import java.util.LinkedList; +import org.onap.policy.aai.RelationshipDataItem; +import org.onap.policy.aai.RelationshipData; +import org.onap.policy.aai.RelatedToPropertyItem; +import org.onap.policy.aai.Relationship; +import org.onap.policy.aai.RelatedToProperty; +import org.onap.policy.aai.RelationshipList; +import org.onap.policy.aai.util.Serialization; +import org.onap.policy.aai.AAIGETVnfResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.junit.Test; + +public class AAIGETVnfResponseTest { + private static final Logger logger = LoggerFactory.getLogger(AAIGETVnfResponseTest.class); + + @Test + public void test() { + AAIGETVnfResponse response = new AAIGETVnfResponse(); + + response.vnfID = "83f674e8-7555-44d7-9a39-bdc3770b0491"; + response.vnfName = "lll_vnf_010317"; + response.vnfType = "Basa-122216-Service/VidVsamp12BaseVolume 1"; + response.serviceId = "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"; + response.orchestrationStatus = "Created"; + response.inMaint = "false"; + response.isClosedLoopDisabled = "false"; + response.resourceVersion = "1494001988835"; + response.modelInvariantId = "f18be3cd-d446-456e-9109-121d9b62feaa"; + + RelationshipList relationshipList = new RelationshipList(); + Relationship relationship = new Relationship(); + RelationshipData relationshipData = new RelationshipData(); + RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); + + relationshipDataItem.relationshipKey = "customer.global-customer-id"; + relationshipDataItem.relationshipValue = "MSO_1610_ST"; + relationshipData.relationshipData.add(relationshipDataItem); + + relationshipDataItem.relationshipKey = "service-subscription.service-type"; + relationshipDataItem.relationshipValue = "MSO-dev-service-type"; + relationshipData.relationshipData.add(relationshipDataItem); + + relationshipDataItem.relationshipKey = "service-instance.service-instance-id"; + relationshipDataItem.relationshipValue = "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"; + relationshipData.relationshipData.add(relationshipDataItem); + + RelatedToProperty relatedToProperty = new RelatedToProperty(); + RelatedToPropertyItem item = new RelatedToPropertyItem(); + item.propertyKey = "service-instance.service-instance-name"; + item.propertyValue = "lll_svc_010317"; + relatedToProperty.relatedTo.add(item); + + relationship.relatedTo = "service-instance"; + relationship.relatedLink = "/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"; + relationship.relationshipData = relationshipData; + relationship.relatedToProperty = relatedToProperty; + + relationshipList.relationshipList.add(relationship); + response.relationshipList = relationshipList; + + logger.info(Serialization.gsonPretty.toJson(response)); + } +} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java new file mode 100644 index 000000000..b24826576 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.policy.aai; + +import static org.junit.Assert.*; +import java.util.List; +import java.util.LinkedList; +import org.onap.policy.aai.RelationshipDataItem; +import org.onap.policy.aai.RelationshipData; +import org.onap.policy.aai.RelatedToPropertyItem; +import org.onap.policy.aai.Relationship; +import org.onap.policy.aai.RelatedToProperty; +import org.onap.policy.aai.RelationshipList; +import org.onap.policy.aai.util.Serialization; +import org.onap.policy.aai.AAIGETVserverResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.junit.Test; + +public class AAIGETVserverResponseTest { + private static final Logger logger = LoggerFactory.getLogger(AAIGETVserverResponseTest.class); + + @Test + public void test() { + AAIGETVserverResponse response = new AAIGETVserverResponse(); + + response.vserverID = "d0668d4f-c25e-4a1b-87c4-83845c01efd8"; + response.vserverName = "USMSO1SX7NJ0103UJZZ01-vjunos0"; + response.vserverName2 = "vjunos0"; + response.vserverSelflink = "https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8"; + response.inMaint = "false"; + response.isClosedLoopDisabled = "false"; + response.resourceVersion = "1494001931513"; + + RelationshipList relationshipList = new RelationshipList(); + Relationship relationship = new Relationship(); + RelationshipData relationshipData = new RelationshipData(); + RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); + + relationshipDataItem.relationshipKey = "customer.global-customer-id"; + relationshipDataItem.relationshipValue = "MSO_1610_ST"; + relationshipData.relationshipData.add(relationshipDataItem); + + relationshipDataItem.relationshipKey = "service-subscription.service-type"; + relationshipDataItem.relationshipValue = "MSO-dev-service-type"; + relationshipData.relationshipData.add(relationshipDataItem); + + relationshipDataItem.relationshipKey = "service-instance.service-instance-id"; + relationshipDataItem.relationshipValue = "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"; + relationshipData.relationshipData.add(relationshipDataItem); + + RelatedToProperty relatedToProperty = new RelatedToProperty(); + RelatedToPropertyItem item = new RelatedToPropertyItem(); + item.propertyKey = "service-instance.service-instance-name"; + item.propertyValue = "lll_svc_010317"; + relatedToProperty.relatedTo.add(item); + + relationship.relatedTo = "service-instance"; + relationship.relatedLink = "/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"; + relationship.relationshipData = relationshipData; + relationship.relatedToProperty = relatedToProperty; + + relationshipList.relationshipList.add(relationship); + response.relationshipList = relationshipList; + + logger.info(Serialization.gsonPretty.toJson(response)); + } + +} \ No newline at end of file -- cgit 1.2.3-korg