From d10de42d72968e616276e2172cdaee7a26b2ccca Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Wed, 15 Aug 2018 14:29:07 -0400 Subject: Add scaffolding to netbox adaptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic9e4dc99a21917446e72e5cfbfb023872a38952b Issue-ID: CCSDK-462 Signed-off-by: Alexis de Talhouët --- netbox-client/features/ccsdk-netbox-client/pom.xml | 64 +++++++++ .../features/features-netbox-client/pom.xml | 45 ++++++ netbox-client/features/pom.xml | 39 +++++ netbox-client/installer/pom.xml | 158 +++++++++++++++++++++ .../src/assembly/assemble_installer_zip.xml | 53 +++++++ .../src/assembly/assemble_mvnrepo_zip.xml | 43 ++++++ .../src/main/resources/scripts/install-feature.sh | 34 +++++ netbox-client/pom.xml | 41 ++++++ netbox-client/provider/pom.xml | 83 +++++++++++ pom.xml | 7 +- 10 files changed, 565 insertions(+), 2 deletions(-) create mode 100644 netbox-client/features/ccsdk-netbox-client/pom.xml create mode 100755 netbox-client/features/features-netbox-client/pom.xml create mode 100755 netbox-client/features/pom.xml create mode 100755 netbox-client/installer/pom.xml create mode 100644 netbox-client/installer/src/assembly/assemble_installer_zip.xml create mode 100644 netbox-client/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 netbox-client/installer/src/main/resources/scripts/install-feature.sh create mode 100644 netbox-client/pom.xml create mode 100644 netbox-client/provider/pom.xml diff --git a/netbox-client/features/ccsdk-netbox-client/pom.xml b/netbox-client/features/ccsdk-netbox-client/pom.xml new file mode 100644 index 00000000..e2f0bb2e --- /dev/null +++ b/netbox-client/features/ccsdk-netbox-client/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + ccsdk-netbox-client + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + + org.onap.ccsdk.sli.core + ccsdk-sli + xml + features + + + + org.onap.ccsdk.sli.core + ccsdk-dblib + ${ccsdk.sli.core.version} + xml + features + + + + ${project.groupId} + netbox-client-provider + ${project.version} + + + diff --git a/netbox-client/features/features-netbox-client/pom.xml b/netbox-client/features/features-netbox-client/pom.xml new file mode 100755 index 00000000..f775d6c6 --- /dev/null +++ b/netbox-client/features/features-netbox-client/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + features-netbox-client + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-netbox-client + ${project.version} + xml + features + + + + diff --git a/netbox-client/features/pom.xml b/netbox-client/features/pom.xml new file mode 100755 index 00000000..df5c3e1e --- /dev/null +++ b/netbox-client/features/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + netbox-client-features + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + + + ccsdk-netbox-client + features-netbox-client + + diff --git a/netbox-client/installer/pom.xml b/netbox-client/installer/pom.xml new file mode 100755 index 00000000..2e8680d9 --- /dev/null +++ b/netbox-client/installer/pom.xml @@ -0,0 +1,158 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + netbox-client-installer + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + + + sdnc-netbox-client + ${application.name} + mvn:org.onap.ccsdk.sli.adaptors/${features.boot}/${project.version}/xml/features + + false + + + + + + org.onap.ccsdk.sli.adaptors + ccsdk-netbox-client + ${project.version} + xml + features + + + * + * + + + + + + org.onap.ccsdk.sli.adaptors + netbox-client-provider + ${project.version} + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.core,org.opendaylight + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + diff --git a/netbox-client/installer/src/assembly/assemble_installer_zip.xml b/netbox-client/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 00000000..ea3bef72 --- /dev/null +++ b/netbox-client/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,53 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + diff --git a/netbox-client/installer/src/assembly/assemble_mvnrepo_zip.xml b/netbox-client/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 00000000..4950f527 --- /dev/null +++ b/netbox-client/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,43 @@ + + + + + + mvnrepo_zip + + zip + + + + false + + + + target/assembly/ + . + + + + + + + diff --git a/netbox-client/installer/src/main/resources/scripts/install-feature.sh b/netbox-client/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 00000000..b4886912 --- /dev/null +++ b/netbox-client/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# +# Copyright (C) 2018 AT&T, Bell Canada +# +# 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. +# + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -nd ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/netbox-client/pom.xml b/netbox-client/pom.xml new file mode 100644 index 00000000..d16f0573 --- /dev/null +++ b/netbox-client/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + netbox-client + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-adaptors :: netbox-client + The SDNC Adaptors for netbox IPAM as an OSGi service + + + provider + features + installer + + + diff --git a/netbox-client/provider/pom.xml b/netbox-client/provider/pom.xml new file mode 100644 index 00000000..af4f812f --- /dev/null +++ b/netbox-client/provider/pom.xml @@ -0,0 +1,83 @@ + + + + + + org.onap.ccsdk.parent + binding-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + netbox-client-provider + 0.3.0-SNAPSHOT + bundle + 4.0.0 + + ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + + + + junit + junit + ${junit.version} + + + com.google.code.gson + gson + ${gson.version} + + + org.apache.httpcomponents + httpclient-osgi + ${apache.httpcomponents.client.version} + + + org.apache.httpcomponents + httpasyncclient-osgi + 4.1.3 + + + org.apache.httpcomponents + httpcore-osgi + ${apache.httpcomponents.core.version} + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + + org.onap.ccsdk.sli.adaptors.netbox.ipam, + org.onap.ccsdk.sli.adaptors.netbox.model, + org.onap.ccsdk.sli.adaptors.netbox.query + + + + + + + + diff --git a/pom.xml b/pom.xml index bb7d0b51..9f650c08 100755 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> org.onap.ccsdk.parent @@ -39,7 +39,9 @@ sdnc-javadoc - dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/adaptors/${project.artifactId}/${project.version} + + dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/adaptors/${project.artifactId}/${project.version} + @@ -109,6 +111,7 @@ aai-service ansible-adapter saltstack-adapter + netbox-client mdsal-resource resource-assignment sql-resource -- cgit 1.2.3-korg