swagger expose Northbound endpoints
Change-Id: I8c19590e24fdf45655386f4abeee2828cc9cb30a
diff --git a/osam-common/pom.xml b/osam-common/pom.xml
new file mode 100644
index 0000000..c2311ce
--- /dev/null
+++ b/osam-common/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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=========================================================
+ */-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <groupId>org.onap.osam</groupId>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>osam-common</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <swagger.version>2.8.0</swagger.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.9.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>1.16.22</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger2</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/osam-common/src/main/java/org/onap/osam/common/dto/AccessPodDTO.java b/osam-common/src/main/java/org/onap/osam/common/dto/AccessPodDTO.java
new file mode 100644
index 0000000..6041d58
--- /dev/null
+++ b/osam-common/src/main/java/org/onap/osam/common/dto/AccessPodDTO.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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.osam.common.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * Created by cemturker on 01.10.2018.
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonRootName("AccessPod")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel
+public class AccessPodDTO {
+ @ApiModelProperty(hidden = true)
+ private Long id;
+ @ApiModelProperty(required = true)
+ private String pnfId;
+ @ApiModelProperty(required = true, value="IP address of Abstract OLT for this POD")
+ private String ip;
+ @ApiModelProperty(required = true, value="GRPC Port of Abstract OLT for this POD")
+ private String port;
+ @ApiModelProperty(required = true, value="IP address of a SEBA POD")
+ private String coreIp;
+ @ApiModelProperty(required = true, value="Port of a SEBA POD")
+ private String corePort;
+ @ApiModelProperty(required = true, value="XOS Username of a SEBA POD")
+ private String username;
+ @ApiModelProperty(required = true, value="XOS Password of a SEBA POD")
+ private String password;
+ @ApiModelProperty(hidden = true)
+ private List<ChassisDTO> chassises;
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("AccessPodDTO{");
+ sb.append("id=").append(id);
+ sb.append(", pnfId='").append(pnfId).append('\'');
+ sb.append(", ip='").append(ip).append('\'');
+ sb.append(", port='").append(port).append('\'');
+ sb.append(", coreIp='").append(coreIp).append('\'');
+ sb.append(", corePort='").append(corePort).append('\'');
+ sb.append(", username='").append(username).append('\'');
+ sb.append(", password='").append(password).append('\'');
+ sb.append(", chassises=").append(chassises);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/osam-common/src/main/java/org/onap/osam/common/dto/ChassisDTO.java b/osam-common/src/main/java/org/onap/osam/common/dto/ChassisDTO.java
new file mode 100644
index 0000000..9f7d561
--- /dev/null
+++ b/osam-common/src/main/java/org/onap/osam/common/dto/ChassisDTO.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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.osam.common.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@JsonRootName("Chassis")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel
+public class ChassisDTO {
+ @ApiModelProperty(hidden = true)
+ private Long id;
+ @ApiModelProperty(required = true, value="CLLI of the chassis")
+ private String clli;
+ @ApiModelProperty(required = true, value="PNF ID of the POD on top of which this chassis is registered")
+ private String pnfId;
+ @ApiModelProperty(required = true, value="Shelf number for this chassis")
+ private int shelf;
+ @ApiModelProperty(required = true, value="Rack number for this chassis")
+ private int rack;
+ @ApiModelProperty(hidden = true)
+ private List<OLTChassisDTO> olts;
+}
diff --git a/osam-common/src/main/java/org/onap/osam/common/dto/OLTChassisDTO.java b/osam-common/src/main/java/org/onap/osam/common/dto/OLTChassisDTO.java
new file mode 100644
index 0000000..a7bae08
--- /dev/null
+++ b/osam-common/src/main/java/org/onap/osam/common/dto/OLTChassisDTO.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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.osam.common.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.nio.file.AccessMode;
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@JsonRootName("OLT")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel
+public class OLTChassisDTO {
+ @ApiModelProperty(hidden = true)
+ private Long id;
+ @ApiModelProperty(required = true, value="CLLI of the chassis on top of which this OLT-specific chassis is registered")
+ private String clli;
+ @ApiModelProperty(required = true, allowableValues = "OPENOLT, ASFVOLT16, ADTRAN, TIBITS", value="OLT Driver for this OLT-specific chassis")
+ private String oltDriver;
+ @ApiModelProperty(required = true, allowableValues = "EDGECORE, ADTRAN, TIBITS", value="OLT Type for this OLT-specific chassis")
+ private String oltType;
+ @ApiModelProperty(required = true, value="Number of ports for this OLT-specific chassis")
+ private int portNumber;
+ @ApiModelProperty(required = true, value="IP address of this OLT-specific chassis")
+ private String ipAddress;
+ @ApiModelProperty(required = true, value="Name of this OLT-specific chassis")
+ private String name;
+ @ApiModelProperty(hidden = true)
+ private List<OLTPortDTO> oltPorts;
+}
diff --git a/osam-common/src/main/java/org/onap/osam/common/dto/OLTPortDTO.java b/osam-common/src/main/java/org/onap/osam/common/dto/OLTPortDTO.java
new file mode 100644
index 0000000..5ad32f6
--- /dev/null
+++ b/osam-common/src/main/java/org/onap/osam/common/dto/OLTPortDTO.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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.osam.common.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+//import org.onap.osam.model.dao.ActivityState;
+//import org.onap.osam.model.dao.AdminState;
+
+import java.util.List;
+
+/**
+ * Created by cemturker on 03.10.2018.
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonRootName("OLTPort")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class OLTPortDTO {
+ private Long id;
+ private Integer portNumber;
+ private /*ActivityState*/ String portAuthState;
+ private /*AdminState*/ String adminState;
+ private List<ONTDTO> ontDevices;
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("OLTPortDTO{");
+ sb.append("id=").append(id);
+ sb.append(", portNumber=").append(portNumber);
+ sb.append(", portAuthState=").append(portAuthState);
+ sb.append(", adminState=").append(adminState);
+ sb.append(", ontDevices=").append(ontDevices);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/osam-common/src/main/java/org/onap/osam/common/dto/ONTDTO.java b/osam-common/src/main/java/org/onap/osam/common/dto/ONTDTO.java
new file mode 100644
index 0000000..6800bae
--- /dev/null
+++ b/osam-common/src/main/java/org/onap/osam/common/dto/ONTDTO.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM Core
+ * ================================================================================
+ * Copyright (C) 2018 Netsia
+ * ================================================================================
+ * 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.osam.common.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@JsonRootName("ONTDevice")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel
+public class ONTDTO {
+ @ApiModelProperty(hidden = true)
+ private Long id;
+ @ApiModelProperty(required = true, value="CLLI of the chassis on top of which this ONT device is registered")
+ private String clli;
+ @ApiModelProperty(required = true, value="Serial number of this ONT device")
+ private String serialNumber;
+ @ApiModelProperty(required = true, value="OLT Slot number of this ONT device")
+ private int slotNumber;
+ @ApiModelProperty(required = true, value="OLT Port number of this ONT device")
+ private int portNumber;
+ private int ontNumber;
+ private int stag;
+ private int ctag;
+ private String nasPortId;
+ private String circuitId;
+ private String technologyProfile;
+ private String speedProfile;
+}