summaryrefslogtreecommitdiffstats
path: root/esr-mgr/src
diff options
context:
space:
mode:
authorLiZi <li.zi30@zte.com.cn>2018-02-28 21:59:30 -0500
committerLiZi <li.zi30@zte.com.cn>2018-02-28 22:12:18 -0500
commit968b74fa8e5d13308e6b1a58392d16d3469f2980 (patch)
treee0cc83592fe05f1e9158d5bf9f5b2cb6aa5447c5 /esr-mgr/src
parentb0512c0b66d91ca71a53e4f4b9073a2b509d0eaf (diff)
Add complex API definition.
Change-Id: I7d1626b9f032901d491be3828db658b01b6d3947 Issue-ID: AAI-823 Signed-off-by: LiZi <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src')
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java2
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java4
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/Relationship.java58
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/RelationshipData.java47
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ICloudRegion.java30
5 files changed, 131 insertions, 10 deletions
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> 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
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;
}