Add complex API definition. 19/33519/2
authorLiZi <li.zi30@zte.com.cn>
Thu, 1 Mar 2018 02:59:30 +0000 (21:59 -0500)
committerLiZi <li.zi30@zte.com.cn>
Thu, 1 Mar 2018 03:12:18 +0000 (22:12 -0500)
Change-Id: I7d1626b9f032901d491be3828db658b01b6d3947
Issue-ID: AAI-823
Signed-off-by: LiZi <li.zi30@zte.com.cn>
esr-mgr/pom.xml
esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java
esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java
esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/Relationship.java [new file with mode: 0644]
esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/RelationshipData.java [new file with mode: 0644]
esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java

index 33a0c1c..586c6c4 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!--
 
-    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.
         <dependency>
             <groupId>io.dropwizard</groupId>
             <artifactId>dropwizard-core</artifactId>
+                       <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                                       <artifactId>jackson-databind</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>io.dropwizard</groupId>
                 </exclusion>
             </exclusions>
         </dependency>
-               <dependency>
-                       <groupId>com.fasterxml.jackson.core</groupId>
-                       <artifactId>jackson-databind</artifactId>
-                       <version>2.9.4</version>
-                       <exclusions>
-                <exclusion>
-                    <groupId>com.github.roskart.dropwizard-jaxws</groupId>
-                                       <artifactId>dropwizard-jaxws</artifactId>
-                </exclusion>
-            </exclusions>
-               </dependency>
         <!-- jersey -->
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
index 10d8a9f..401a1b7 100644 (file)
@@ -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.
index dd0a136..4b64cf0 100644 (file)
@@ -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 (file)
index 0000000..92967d8
--- /dev/null
@@ -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> 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<RelationshipData> getRelationshipData() {
+        return relationshipData;
+    }
+
+    public void setRelationshipData(List<RelationshipData> 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 (file)
index 0000000..96462d7
--- /dev/null
@@ -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;
+    }
+
+}
index 43b9837..e5f6531 100644 (file)
@@ -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;
 }