From: LiZi Date: Thu, 1 Mar 2018 02:59:30 +0000 (-0500) Subject: Add complex API definition. X-Git-Tag: v1.1.0~18^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fesr-server.git;a=commitdiff_plain;h=968b74fa8e5d13308e6b1a58392d16d3469f2980 Add complex API definition. Change-Id: I7d1626b9f032901d491be3828db658b01b6d3947 Issue-ID: AAI-823 Signed-off-by: LiZi --- diff --git a/esr-mgr/pom.xml b/esr-mgr/pom.xml index 33a0c1c..586c6c4 100644 --- a/esr-mgr/pom.xml +++ b/esr-mgr/pom.xml @@ -1,7 +1,7 @@ org.glassfish.jersey.core diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java index 10d8a9f..401a1b7 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java @@ -1,5 +1,5 @@ /** - * Copyright 2016-2017 ZTE Corporation. + * Copyright 2016-2018 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java index dd0a136..4b64cf0 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright 2016-2017 ZTE Corporation. + * Copyright 2016-2018 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,8 @@ package org.onap.aai.esr; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; import org.hibernate.validator.constraints.NotEmpty; -import org.jvnet.hk2.annotations.Service; import javax.validation.Valid; -@Service public class ExtsysAppConfiguration extends Configuration { @NotEmpty private String template; diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/Relationship.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/Relationship.java new file mode 100644 index 0000000..92967d8 --- /dev/null +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/Relationship.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * 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. + */ +package org.onap.aai.esr.entity.aai; + +import java.io.Serializable; +import java.util.List; +import com.google.gson.annotations.SerializedName; + +public class Relationship implements Serializable{ + + public static final long serialVersionUID = 1L; + + @SerializedName("related-to") + private String relatedTo; + + @SerializedName("related-link") + private String relatedLink; + + @SerializedName("relationship-data") + private List relationshipData; + + public String getRelatedTo() { + return relatedTo; + } + + public void setRelatedTo(String relatedTo) { + this.relatedTo = relatedTo; + } + + public String getRelatedLink() { + return relatedLink; + } + + public void setRelatedLink(String relatedLink) { + this.relatedLink = relatedLink; + } + + public List getRelationshipData() { + return relationshipData; + } + + public void setRelationshipData(List relationshipData) { + this.relationshipData = relationshipData; + } +} diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/RelationshipData.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/RelationshipData.java new file mode 100644 index 0000000..96462d7 --- /dev/null +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/RelationshipData.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * 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. + */ +package org.onap.aai.esr.entity.aai; + +import java.io.Serializable; +import com.google.gson.annotations.SerializedName; + +public class RelationshipData implements Serializable{ + + public static final long serialVersionUID = 1L; + + @SerializedName("relationship-key") + private String relationshipKey; + + @SerializedName("relationship-value") + private String relationshipValue; + + public String getRelationshipKey() { + return relationshipKey; + } + + public void setRelationshipKey(String relationshipKey) { + this.relationshipKey = relationshipKey; + } + + public String getRelationshipValue() { + return relationshipValue; + } + + public void setRelationshipValue(String relationshipValue) { + this.relationshipValue = relationshipValue; + } + +} diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java index 43b9837..e5f6531 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java @@ -1,5 +1,5 @@ /** - * Copyright 2017 ZTE Corporation. + * Copyright 2017-2018 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,14 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import org.onap.aai.esr.entity.aai.CloudRegionDetail; +import org.onap.aai.esr.entity.aai.Relationship; import org.onap.aai.esr.exception.ExtsysException; - -@Path("/cloud-regions") +@Path("/") public interface ICloudRegion { @PUT - @Path("/cloud-region/{cloud_owner}/{cloud_region_id}") + @Path("/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public void registerVIMService(@HeaderParam("X-TransactionId") String transactionId, @@ -42,7 +42,7 @@ public interface ICloudRegion { CloudRegionDetail cloudRegion) throws ExtsysException; @GET - @Path("/cloud-region/{cloud_owner}/{cloud_region_id}?depth=all") + @Path("/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}?depth=all") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public String queryVIMDetail(@HeaderParam("X-TransactionId") String transactionId, @@ -51,6 +51,7 @@ public interface ICloudRegion { throws ExtsysException; @GET + @Path("/cloud-regions") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public String queryVIMList(@HeaderParam("X-TransactionId") String transactionId, @@ -58,11 +59,28 @@ public interface ICloudRegion { throws ExtsysException; @DELETE - @Path("/cloud-region/{cloud_owner}/{cloud_region_id}") + @Path("/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public void deleteVim(@HeaderParam("X-TransactionId") String transactionId, @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization, @PathParam("cloud_owner") String cloud_owner, @PathParam("cloud_region_id") String cloud_region_id, @QueryParam("resource-version") String resourceVersion) throws ExtsysException; + + @PUT + @Path("/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}/relationship-list/relationship") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public void putRelationship(@HeaderParam("X-TransactionId") String transactionId, + @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization, + @PathParam("cloud_owner") String cloud_owner, @PathParam("cloud_region_id") String cloud_region_id, + Relationship relationship) throws ExtsysException; + + @GET + @Path("/complexes") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public String queryComplexList(@HeaderParam("X-TransactionId") String transactionId, + @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization) + throws ExtsysException; }