diff options
26 files changed, 3632 insertions, 0 deletions
diff --git a/vesagent/docker/Dockerfile b/vesagent/docker/Dockerfile new file mode 100644 index 0000000..3b5b8e4 --- /dev/null +++ b/vesagent/docker/Dockerfile @@ -0,0 +1,26 @@ +# Use an official Python runtime as a parent image +FROM python:2.7.14 + +# Make port <Port Num> available to the world outside this container +#EXPOSE <Port Num> + +RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list && \ + apt-get update && \ + apt-get install -y vim && \ + apt-get install -y zip && \ + apt-get install -y unzip && \ + apt-get install -y curl && \ + apt-get install -y wget && \ + apt-get install -y -t jessie-backports openjdk-8-jre-headless ca-certificates-java + +# Set the working directory to /opt +WORKDIR /opt + +# Copy the local opt directory contents into the container at /opt +ADD opt /opt + +# Install any needed packages specified in requirements.txt +RUN pip install -r requirements.txt + +# Run application when the container launches +CMD [ "/opt/start-manager.sh" ] diff --git a/vesagent/docker/docker-build.sh b/vesagent/docker/docker-build.sh new file mode 100755 index 0000000..2b2f100 --- /dev/null +++ b/vesagent/docker/docker-build.sh @@ -0,0 +1,95 @@ +#!/bin/bash +echo "WORKSPACE: ${WORKSPACE}" +VERSION="1.0.0-SNAPSHOT" + +# +# Copy vesagent Uber JAR to docker app directory +# +APP=${WORKSPACE}/vesagent/target/vesagent-${VERSION}.jar + +if [ ! -f "${APP}" ] +then + echo "FATAL error cannot locate ${APP}" + exit 2 +fi + +APP_DIR=${WORKSPACE}/vesagent/docker/opt + +[ -d "${APP_DIR}/vesagent-${VERSION}.jar" ] && rm -rf "${APP_DIR}/vesagent-${VERSION}.jar" + +cp ${APP} ${APP_DIR} + +# +# Copy configurations directory +# +CONF_DIR=${WORKSPACE}/vesagent/etc + +if [ ! -d "${CONF_DIR}" ] +then + echo "FATAL error cannot locate ${CONF_DIR}" + exit 2 +fi + +APP_DIR=${WORKSPACE}/vesagent/docker/opt + +[ -d "${APP_DIR}/etc" ] && rm -rf "${APP_DIR}/etc" + +cp -a ${CONF_DIR} ${APP_DIR} + +# +# Copy python scripts directory +# +PY_DIR=${WORKSPACE}/vesagent/py + +if [ ! -d "${PY_DIR}" ] +then + echo "FATAL error cannot locate ${PY_DIR}" + exit 2 +fi + +if [ -d "${PY_DIR}" ] +then + echo "Remove all dummy & test scripts" + rm -f ${PY_DIR}/dummy* + rm -f ${PY_DIR}/test* +fi + +APP_DIR=${WORKSPACE}/vesagent/docker/opt + +[ -d "${APP_DIR}/py" ] && rm -rf "${APP_DIR}/py" + +cp -a ${PY_DIR} ${APP_DIR} + +# +# build the docker image. tag and then push to the remote repo +# +BUILD_ARGS="--no-cache" +DOCKER_REPOSITORY="nexus3.onap.org:10003" +ORG="onap" +PROJECT="multicloud" +IMAGE="vio-vesagent" +VERSION="${VERSION//[^0-9.]/}" +IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" + +if [ $HTTP_PROXY ]; then + BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}" +fi +if [ $HTTPS_PROXY ]; then + BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}" +fi + +function build_image { + # build the image + echo "Start build docker image: ${IMAGE_NAME}" + docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest . +} + +function push_image { + # push the image + echo "Start push docker image: ${IMAGE_NAME}" + docker push ${IMAGE_NAME}:${VERSION} + docker push ${IMAGE_NAME}:latest +} + +build_image +push_image diff --git a/vesagent/docker/opt/requirements.txt b/vesagent/docker/opt/requirements.txt new file mode 100644 index 0000000..92a4890 --- /dev/null +++ b/vesagent/docker/opt/requirements.txt @@ -0,0 +1,5 @@ +# VMWare vSphere Management SDK +pyvmomi==6.5.0.2017.5-1 + +# Pure Python Vi Implementation +pyvim==0.0.21 diff --git a/vesagent/docker/opt/start-manager.sh b/vesagent/docker/opt/start-manager.sh new file mode 100755 index 0000000..76adfe4 --- /dev/null +++ b/vesagent/docker/opt/start-manager.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# TODO: Enable the below command to execute the VESAgent process +exec java -jar /opt/vesagent-1.0.0-SNAPSHOT.jar /opt/etc/Agent.properties +#while :; do echo 'sleeping for 3600 secs'; sleep 3600; done diff --git a/vesagent/etc/Agent.properties b/vesagent/etc/Agent.properties new file mode 100644 index 0000000..99fb9ed --- /dev/null +++ b/vesagent/etc/Agent.properties @@ -0,0 +1,2 @@ +Path_VspherePython=/opt/py/getAllVmInfo.py
+Python_Output_Json=/opt/py/final-res.json
diff --git a/vesagent/pom.xml b/vesagent/pom.xml new file mode 100644 index 0000000..3dfba1b --- /dev/null +++ b/vesagent/pom.xml @@ -0,0 +1,122 @@ +<?xml version="1.0"?> +<!-- + Copyright (c) 2017 VMware, Inc. + + 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. +--> +<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"> + <parent> + <groupId>org.onap.oparent</groupId> + <artifactId>oparent</artifactId> + <version>1.0.0-SNAPSHOT</version> + <relativePath>../oparent</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.onap.multicloud.openstack.vmware</groupId> + <artifactId>vesagent</artifactId> + <version>1.0.0-SNAPSHOT</version> + <name>multicloud-openstack-vmware-vesagent</name> + <description>multicloud vesagent</description> + <properties> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.12</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1.1</version> + <scope>compile</scope> + </dependency> + <!-- https://mvnrepository.com/artifact/com.vmware/vijava --> +<!-- <dependency> + <groupId>com.vmware</groupId> + <artifactId>vijava</artifactId> + <version>5.1</version> + </dependency> +--> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient-osgi --> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-osgi</artifactId> + <version>4.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.21</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + <version>1.2.17</version> + </dependency> +<!-- <dependency> + <groupId>org.python</groupId> + <artifactId>jython</artifactId> + <version>2.7.0</version> + <scope>compile</scope> + </dependency> +--> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.3</version> + <inherited>false</inherited> + <executions> + <!-- Run shade goal on package phase --> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <transformers> + <!-- add Main-Class to manifest file --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.onap.multicloud.openstack.vmware.VesAgent</mainClass> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/vesagent/py/dummylist.py b/vesagent/py/dummylist.py new file mode 100644 index 0000000..28ed71f --- /dev/null +++ b/vesagent/py/dummylist.py @@ -0,0 +1,5 @@ +dummylist = [] +dummysingleinfo = {'Heartbeatstatus': 'gray', 'Name': 'openstack-template', 'Instance UUID': '502261f8-f9b5-4430-fc9b-4cbbd9a9da1c'} +dummylist.append(dummysingleinfo) +print("in dummylist.py",dummylist) +#listjson[] = [{'Heartbeatstatus': 'gray', 'Name': 'openstack-template', 'Instance UUID': '502261f8-f9b5-4430-fc9b-4cbbd9a9da1c'}, {'Heartbeatstatus': 'green', 'Name': 'management-server', 'Instance UUID': '50229363-1961-25ea-5909-b395b5e90701'}, {'Heartbeatstatus': 'gray', 'Name': 'New Virtual Machine', 'Instance UUID': '5022143f-6758-05f8-c5bc-777994f09590'}, {'Heartbeatstatus': 'gray', 'Name': 'metadata_proxy_router-8802f84c-bc25-437a-b7f7-6b1f44db673a-0', 'Instance UUID': '5022efd1-8dff-6dab-92ac-f56be0ef2890'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_onap', 'Instance UUID': '5022889f-48e5-cfb7-7e42-849492f52074'}, {'Heartbeatstatus': 'gray', 'Name': 'testvm2', 'Instance UUID': '50227161-5bdb-f1c7-a35e-9e1ccc690c4a'}, {'Heartbeatstatus': 'green', 'Name': 'dhcp-ddaec694-47ac-4-0', 'Instance UUID': '5022b051-bee7-970e-b542-03c1dd2371f8'}, {'Heartbeatstatus': 'green', 'Name': 'JumoHost3', 'Instance UUID': '5022a29a-c22b-95f6-8db1-64ed99b466a7'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-9dfc0681-0884-0', 'Instance UUID': '5022c282-d2b3-ddfe-afb9-3e3b1eff586a'}, {'Heartbeatstatus': 'gray', 'Name': 'DNS-clone', 'Instance UUID': '502286c7-5ae5-d832-c8e3-1cd2fb9fdfd5'}, {'Heartbeatstatus': 'gray', 'Name': 'Ubuntu_14.04', 'Instance UUID': '502237a7-1af7-5276-7661-447a00f555c2'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-6ff1b0b8-a87f-0', 'Instance UUID': '50224658-086c-b89c-fec8-99a9a68b79e5'}, {'Heartbeatstatus': 'green', 'Name': 'NSX_Controller_abfcd152-179c-441d-bde1-7eb3c95515e8', 'Instance UUID': '5022c971-9074-73b7-436e-df4ed727de18'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-341aac43-9b8d-0', 'Instance UUID': '5022bfea-4d1a-18be-31c0-4f47deb9d45b'}, {'Heartbeatstatus': 'green', 'Name': 'NSX_Controller_210c505a-fd0d-487c-aa13-c8e7c783fbd2', 'Instance UUID': '5022decc-330a-27f2-9b0c-22bda29849d5'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-f373c488-30bf-0', 'Instance UUID': '5022fc7e-13cc-45a6-5eb2-c583c90d232c'}, {'Heartbeatstatus': 'green', 'Name': 'NSX_Controller_d91e4639-fb12-4db3-b724-840ab671fee7', 'Instance UUID': '5022dd32-6c9b-a926-3545-84ed04654aef'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-696832d4-f7a3-0', 'Instance UUID': '5022b4e3-8298-becf-d7ff-9327ddd79da3'}, {'Heartbeatstatus': 'gray', 'Name': 'testvm1', 'Instance UUID': '502284ac-8a4b-00d7-7a1b-b457d16279e5'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-750f9290-a800-0', 'Instance UUID': '50226a36-d367-4dbe-2424-c6b9f9dab53f'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-08096265-239d-0', 'Instance UUID': '502224a1-8cbf-1b5a-f24e-0b462947cd34'}, {'Heartbeatstatus': 'gray', 'Name': 'metadata_proxy_router-79872529-425b-4621-8ec6-ffbbbd9cf2fd-0', 'Instance UUID': '50224e05-a656-2b9b-ffb5-e1bd940f5bac'}, {'Heartbeatstatus': 'green', 'Name': 'centos_gui', 'Instance UUID': '5022a5e7-6328-f472-43e9-c0b6a61fcb99'}, {'Heartbeatstatus': 'gray', 'Name': 'shared-7acbe88d-afb7-0', 'Instance UUID': '50225be5-1b5f-689e-05ae-2db75283c488'}, {'Heartbeatstatus': 'green', 'Name': 'dhcp-7b44ffd8-57d3-4-0', 'Instance UUID': '502262bb-cf5d-587e-e912-8f8625357e75'}, {'Heartbeatstatus': 'green', 'Name': 'NSX-Manager', 'Instance UUID': '5022c6c8-eb9f-a95d-efa0-d8889c590ed2'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-69b84c8d-a635-0', 'Instance UUID': '5022e51a-2628-0f0d-440a-ab979ff6fd64'}, {'Heartbeatstatus': 'green', 'Name': 'shared-f5021549-8b6c-0', 'Instance UUID': '50229bc3-4b19-51a3-a4fe-269312933c6a'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-c4a0d176-07d1-0', 'Instance UUID': '502209c6-f740-7c95-e817-c5e5bb2dc688'}, {'Heartbeatstatus': 'gray', 'Name': 'backup-2510da43-bd31-0', 'Instance UUID': '502288dd-9288-c7b1-50d7-865735068d4e'}, {'Heartbeatstatus': 'gray', 'Name': 'Jumphost2', 'Instance UUID': '500b1c61-6325-f84b-ed15-5a6f309170fd'}, {'Heartbeatstatus': 'green', 'Name': 'DNS', 'Instance UUID': '525fdeb5-a56b-f1e0-61bc-e057a5342431'}, {'Heartbeatstatus': 'green', 'Name': 'vcenter', 'Instance UUID': '527db7b5-e830-3a61-af22-9fb3cc5fb729'}, {'Heartbeatstatus': 'green', 'Name': 'VIO-ControlPlane-0', 'Instance UUID': '502266d2-a940-5983-3ac9-052fcb4b3c5e'}, {'Heartbeatstatus': 'gray', 'Name': 'VIO-Compute-0', 'Instance UUID': '50228a13-2863-ae65-1041-5858a1e266fb'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu16.04testsnap (680d3f89-3407-41b4-85f6-72a1696926b3)', 'Instance UUID': '502243bd-6973-239d-a749-26a31e0a2101'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_16.04_postgres_eph_snap (1d2e2ca8-f566-4108-9af6-e5539cf9e9ca)', 'Instance UUID': '5022f98b-c465-86bb-2044-1e285e0c5dd8'}, {'Heartbeatstatus': 'gray', 'Name': 'Z1dcZONESTATEpstg00_snapshot (c70da0d9-5b0f-414d-b1c7-6ca521879ed6)', 'Instance UUID': '5022ae6f-b728-acce-0eb2-01a19f38958e'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_16.04_snapEFI (7b5ad0bd-acbb-40d8-af84-5f6b3a8be85e)', 'Instance UUID': '502221a2-7c23-d7a3-11f2-9656368e4cd3'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-vid (a40d3b40-7542-4410-990f-d0be53060879)', 'Instance UUID': 'a40d3b40-7542-4410-990f-d0be53060879'}, {'Heartbeatstatus': 'green', 'Name': 'zldcNorthIndiaUPcdap02 (3dda2c96-1fd0-4ae1-b820-95e857464315)', 'Instance UUID': '3dda2c96-1fd0-4ae1-b820-95e857464315'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-aai (737e06e7-cc36-4196-bc67-1675f15957cd)', 'Instance UUID': '737e06e7-cc36-4196-bc67-1675f15957cd'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-robot (676703cd-49d6-499d-9cd7-3d317097ef90)', 'Instance UUID': '676703cd-49d6-499d-9cd7-3d317097ef90'}, {'Heartbeatstatus': 'green', 'Name': 'zldcNorthIndiaUPpstg00 (66e51416-b6c0-443a-acda-731230c06a96)', 'Instance UUID': '66e51416-b6c0-443a-acda-731230c06a96'}, {'Heartbeatstatus': 'green', 'Name': 'test ubuntu 13oct (337a4ebc-51f6-4119-bca8-f06f57a7907f)', 'Instance UUID': '337a4ebc-51f6-4119-bca8-f06f57a7907f'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-message-router (0e14c790-2bdb-4eaa-adee-d0655931499c)', 'Instance UUID': '0e14c790-2bdb-4eaa-adee-d0655931499c'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-sdnc (7337a948-b303-4409-b643-d09e92b48950)', 'Instance UUID': '7337a948-b303-4409-b643-d09e92b48950'}, {'Heartbeatstatus': 'green', 'Name': 'zldcNorthIndiaUPcoll00 (91145edd-f916-46b4-9193-4f1cc7ba836e)', 'Instance UUID': '91145edd-f916-46b4-9193-4f1cc7ba836e'}, {'Heartbeatstatus': 'green', 'Name': 'zldcNorthIndiaUPcdap00 (1e452aaa-ed6d-4519-b16b-eee6294bbaae)', 'Instance UUID': '1e452aaa-ed6d-4519-b16b-eee6294bbaae'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-appc (d22a37b3-56c5-45e3-b07e-3b57a953c70e)', 'Instance UUID': 'd22a37b3-56c5-45e3-b07e-3b57a953c70e'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-policy (a2fd952d-398f-4a10-8d67-517d7568d7ae)', 'Instance UUID': 'a2fd952d-398f-4a10-8d67-517d7568d7ae'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-portal (9b0aec34-59e2-44bd-8009-0f2a80db62e2)', 'Instance UUID': '9b0aec34-59e2-44bd-8009-0f2a80db62e2'}, {'Heartbeatstatus': 'green', 'Name': 'zldcNorthIndiaUPcdap01 (77abd09e-c88c-4a75-a68d-6ef47236a6d8)', 'Instance UUID': '77abd09e-c88c-4a75-a68d-6ef47236a6d8'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-sdc (c310a0bd-4d56-4e95-85d8-93acc8335c36)', 'Instance UUID': 'c310a0bd-4d56-4e95-85d8-93acc8335c36'}, {'Heartbeatstatus': 'green', 'Name': 'ubuntu14.04HA (fbcc941e-e61d-48a6-85e0-9a26695d8a0f)', 'Instance UUID': 'fbcc941e-e61d-48a6-85e0-9a26695d8a0f'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-dcae-controller (c723b2de-25b7-4e9f-b85b-1fb20b52c339)', 'Instance UUID': 'c723b2de-25b7-4e9f-b85b-1fb20b52c339'}, {'Heartbeatstatus': 'green', 'Name': 'onap-vm-mso (01dc316e-388e-4cd9-a72a-c806da4b0833)', 'Instance UUID': '01dc316e-388e-4cd9-a72a-c806da4b0833'}, {'Heartbeatstatus': 'gray', 'Name': 'onap-vm-dns-server (f162bab2-26dc-4288-ac3c-f332b7dd64c7)', 'Instance UUID': 'f162bab2-26dc-4288-ac3c-f332b7dd64c7'}, {'Heartbeatstatus': 'gray', 'Name': 'zldcNorthIndiaUPcdap01 (59d1953b-eec1-40f0-b3c3-160d2eae87f3)', 'Instance UUID': '59d1953b-eec1-40f0-b3c3-160d2eae87f3'}, {'Heartbeatstatus': 'gray', 'Name': 'zldcNorthIndiaUPcoll00 (98273d87-f516-4112-80ad-42a1e8139d0e)', 'Instance UUID': '98273d87-f516-4112-80ad-42a1e8139d0e'}, {'Heartbeatstatus': 'gray', 'Name': 'zldcNorthIndiaUPcdap02 (27eaa1d3-1257-40e3-b0ca-2c6911236ab4)', 'Instance UUID': '27eaa1d3-1257-40e3-b0ca-2c6911236ab4'}, {'Heartbeatstatus': 'gray', 'Name': 'zldcNorthIndiaUPpstg00 (d96aef31-73b4-4ff7-9dd2-21abaf07825f)', 'Instance UUID': 'd96aef31-73b4-4ff7-9dd2-21abaf07825f'}, {'Heartbeatstatus': 'gray', 'Name': 'zldcNorthIndiaUPcdap00 (131adfc0-91a7-468c-8b70-49c7512f26a3)', 'Instance UUID': '131adfc0-91a7-468c-8b70-49c7512f26a3'}, {'Heartbeatstatus': 'gray', 'Name': 'vol1-sdc-data (9c8cae82-2fc9-4014-b4e8-c48fbaa3a39c)', 'Instance UUID': '9c8cae82-2fc9-4014-b4e8-c48fbaa3a39c'}, {'Heartbeatstatus': 'gray', 'Name': '1b38a795-3342-4c78-9561-bd835f3fb150', 'Instance UUID': '502285f4-16c6-cc8b-7a0a-b740487be8fb'}, {'Heartbeatstatus': 'gray', 'Name': '44969d2f-b610-41d8-a1be-b7d648e7855e', 'Instance UUID': '5022e405-1e15-71c1-d711-fdbd77a6e63c'}, {'Heartbeatstatus': 'gray', 'Name': '1ce25f97-3fe6-46ea-803c-fa408963c7c3', 'Instance UUID': '5022731d-8005-5c75-6bb2-0c4d41abc8d3'}, {'Heartbeatstatus': 'gray', 'Name': 'd54d3255-9e97-4f3b-a5eb-7df2790079c9', 'Instance UUID': '5022a091-4198-6a2e-1934-9b567d6db8e1'}, {'Heartbeatstatus': 'gray', 'Name': 'f5758da1-1cc6-4dba-b49d-06c1b916e9e9', 'Instance UUID': '50224e2e-0e55-a2b5-e8f8-30c18022b5dc'}, {'Heartbeatstatus': 'gray', 'Name': '85c03839-ac42-4553-93c1-edfef7654c63', 'Instance UUID': '5022486d-8639-24aa-28fe-adbc2e7847e9'}, {'Heartbeatstatus': 'gray', 'Name': '6b829ed7-a6d2-4515-aff6-9c14502c31fb', 'Instance UUID': '502252b3-9a2d-8d59-8322-f438c9c7ca19'}, {'Heartbeatstatus': 'gray', 'Name': '2d7366ee-7082-451f-9651-3032eb21060c', 'Instance UUID': '5022fac2-8658-85a4-7e1f-d916ce3b1f95'}, {'Heartbeatstatus': 'gray', 'Name': '369dbffd-b575-40fc-93e8-0beeb6aa2c1c', 'Instance UUID': '50228391-c5d2-c62a-456e-0436aab9c2e9'}, {'Heartbeatstatus': 'gray', 'Name': 'fbebd7f9-7e5b-4390-adad-2df091abc2b5', 'Instance UUID': '50228af3-7686-ea84-4c90-8b525897a7be'}, {'Heartbeatstatus': 'gray', 'Name': 'inettest (60d1974d-a4c0-4692-a344-0ea2d9256d96)', 'Instance UUID': '60d1974d-a4c0-4692-a344-0ea2d9256d96'}, {'Heartbeatstatus': 'gray', 'Name': '89848475-69fa-4375-924c-79eb4dc9cdc7', 'Instance UUID': '50226fb3-7fc8-23aa-474f-f888833329b7'}, {'Heartbeatstatus': 'gray', 'Name': 'xenial-server-cloud-80G (fbebd7f9-7e5b-4390-adad-2df091abc2b5)', 'Instance UUID': 'c8f5248f-f488-5f8c-b08c-4395f005e75d'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_16.04_snapEFI-20G (7b5ad0bd-acbb-40d8-af84-5f6b3a8be85e)', 'Instance UUID': '39de4ab1-7dfa-55d0-8964-f5bf5742d9ee'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_14.04b-160G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)', 'Instance UUID': '1aa874c2-c3f2-5f96-b303-0bd3af3d7c52'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_14.04b-20G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)', 'Instance UUID': 'ed786c81-be81-566a-8710-a122dc0399be'}, {'Heartbeatstatus': 'gray', 'Name': 'xenial-server-cloud-20G (fbebd7f9-7e5b-4390-adad-2df091abc2b5)', 'Instance UUID': 'a7eb1923-fc15-58e1-b50f-6c1eb4af1c2d'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_16.04_snapEFI-80G (7b5ad0bd-acbb-40d8-af84-5f6b3a8be85e)', 'Instance UUID': '88751a88-d1e2-50aa-be95-b3f66b2f5ba5'}, {'Heartbeatstatus': 'gray', 'Name': 'xenial-server-cloud-160G (fbebd7f9-7e5b-4390-adad-2df091abc2b5)', 'Instance UUID': 'f9907133-7005-5de5-a5c0-80902324435e'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_14.04b-40G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)', 'Instance UUID': 'eb590b86-a4bd-5da2-b33a-52a88c803250'}, {'Heartbeatstatus': 'gray', 'Name': 'ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)', 'Instance UUID': 'c96367fe-35b8-51be-8391-ea7a1f075cec'}] diff --git a/vesagent/py/getAllVmInfo.py b/vesagent/py/getAllVmInfo.py new file mode 100644 index 0000000..a0c7c6b --- /dev/null +++ b/vesagent/py/getAllVmInfo.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python +# VMware vSphere Python SDK +# Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved. +# +# 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. + +""" +List the vms on an ESX / vCenter host +""" + +from __future__ import print_function +from pyVim.connect import SmartConnect, Disconnect +from pyVmomi import vim +import argparse +import atexit +import getpass +import ssl +import json +import os.path + +fp = None +listjson = [] +propFile="/opt/etc/Agent.properties" + +def GetJsonFileLocation(): + AgntProps = {} + if True == os.path.isfile(propFile): + with open("/opt/etc/Agent.properties") as propfile: + for line in propfile: + name, var = line.partition("=")[::2] + AgntProps[name.strip()] = var + return AgntProps["Python_Output_Json"].strip() + else: + print(propFile+" Not Found") + return None + + +def GetArgs(): + """ + Supports the command-line arguments listed below. + """ + parser = argparse.ArgumentParser( + description='Process args for retrieving all the Virtual Machines') + parser.add_argument('-s', '--host', required=True, action='store', + help='Remote host to connect to') + parser.add_argument('-o', '--port', type=int, default=443, action='store', + help='Port to connect on') + parser.add_argument('-u', '--user', required=True, action='store', + help='User name to use when connecting to host') + parser.add_argument('-p', '--password', required=True, action='store', + help='Password to use when connecting to host') + args = parser.parse_args() + return args + + +def PrintVmInfo(vm, depth=1): + + """ + Print information for a particular virtual machine or recurse into a folder + or vApp with depth protection + """ + maxdepth = 10 + + + # if this is a group it will have children. if it does, recurse into them + # and then return + if hasattr(vm, 'childEntity'): + if depth > maxdepth: + return + vmList = vm.childEntity + for c in vmList: + PrintVmInfo(c, depth+1) + return + + + # if this is a vApp, it likely contains child VMs + # (vApps can nest vApps, but it is hardly a common usecase, so ignore that) + if isinstance(vm, vim.VirtualApp): + vmList = vm.vm + for c in vmList: + PrintVmInfo(c, depth + 1) + return + + + summary = vm.summary + #print("Name : ", summary.config.name) + #print("Path : ", summary.config.vmPathName) + #print("Guest : ", summary.config.guestFullName) + #print("Instance UUID: ", summary.config.instanceUuid) + #print("Heartbeatstatus: ", vm.guestHeartbeatStatus) + if summary.config.name and vm.guestHeartbeatStatus: + singleinfo={} + singleinfo.update({"Name":summary.config.name}) + singleinfo.update({"Instance UUID":summary.config.instanceUuid}) + singleinfo.update({"Heartbeatstatus":vm.guestHeartbeatStatus}) + #print ("Final SINGLEINFO") + listjson.append(singleinfo) + else: + print ("NAME, UUID OR HEARTBEAT NOT PRESENT") + + +def GetContent(args, context): + if hasattr(ssl, '_create_unverified_context'): + context = ssl._create_unverified_context() + si = SmartConnect(host=args.host, + user=args.user, + pwd=args.password, + port=int(args.port), + sslContext=context) + if not si: + print("Could not connect to the specified host using specified " + "username and password") + return -1 + + atexit.register(Disconnect, si) + return si.RetrieveContent() + + +def CreateJsonList(content): + for child in content.rootFolder.childEntity: + if hasattr(child, 'vmFolder'): + datacenter = child + vmFolder = datacenter.vmFolder + vmList = vmFolder.childEntity + for vm in vmList: + PrintVmInfo(vm) + print (listjson) + return listjson + + +def CreateJsonFile(JsonFile, jsonrecord): + if(len(jsonrecord) == 0): + return False + else: + #Return False if File Location is None + print("Json File Location is:",JsonFile) + fp = open(JsonFile, 'w') + if not fp: + return False + else: + json.dump(jsonrecord, fp,sort_keys=True, indent=2) + fp.close() + return True + + +def main(): + """ + Simple command-line program for listing the virtual machines on a system. + """ + args = GetArgs() + + context = None + content = GetContent(args, context) + + jsonrecord = CreateJsonList(content) + + JsonFile = GetJsonFileLocation() + if (None == JsonFile): + return -1 + + if(True == CreateJsonFile(JsonFile, jsonrecord)): + return 0 + else: + return -1 + +# Start program +if __name__ == "__main__": + main() diff --git a/vesagent/py/test_getAllVmInfo.py b/vesagent/py/test_getAllVmInfo.py new file mode 100644 index 0000000..4010d89 --- /dev/null +++ b/vesagent/py/test_getAllVmInfo.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# VMware vSphere Python SDK +# Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved. +# +# 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. + + +import unittest +import getAllVmInfo +import argparse +from dummylist import dummylist + +DummyJsonFile = "final-res.json" + +class TestgetAllVmInfo(unittest.TestCase): + def test_CreateJsonFilePositive(self): + #print ("dummylist is:",dummylist) + self.assertTrue(getAllVmInfo.CreateJsonFile(DummyJsonFile, dummylist)) + + def test_CreateJsonFileNegative(self): + dummylistempty = [] + #print ("dummylist is:",dummylistempty) + self.assertFalse(getAllVmInfo.CreateJsonFile(DummyJsonFile, dummylistempty)) + +if __name__ == '__main__': + unittest.main() diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonAlarmStorage.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonAlarmStorage.java new file mode 100644 index 0000000..b38330e --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonAlarmStorage.java @@ -0,0 +1,26 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import org.json.simple.JSONObject; + +/*JsonAlarmStorage class include + * fields to stote to list + * which will be the value of Map*/ + +public class JsonAlarmStorage { + JSONObject json; + String alarm; + String vesSendStatus; +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonStoreMap.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonStoreMap.java new file mode 100644 index 0000000..deecfd8 --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/JsonStoreMap.java @@ -0,0 +1,176 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/*JsonStoreMap class having all methods + * related with HashMap + * Map taking UUID of VM as key + * Value is List Contain encoded json, alarm condition + * and ves send status + * If need to add any values --> add to JsonStoreMap */ + +public class JsonStoreMap { + protected static final Map<String, List<JsonAlarmStorage>> map = new HashMap<String, List<JsonAlarmStorage>>(); + private final Logger log = LoggerFactory.getLogger(JsonStoreMap.class); + private String line = "......................"; + public Map<String, List<JsonAlarmStorage>> addToMap(String key,List<JsonAlarmStorage> value){ + log.info ("adding to map"); + map.put(key, value); + return map; + } + public Map<String, List<JsonAlarmStorage>> updateMap(String key,List<JsonAlarmStorage> value){ + log.info("updating map"); + map.put(key, value); + return map; + } + public Map<String, List<JsonAlarmStorage>> updateMapBatch(String vesSendStatus){ + log.info("updating map for batch"); + Iterator i = map.keySet().iterator(); + while(i.hasNext()) + { + String key = i.next().toString(); + List<JsonAlarmStorage> value = map.get(key); + value.get(0).vesSendStatus = vesSendStatus; + } + log.info("updated total batch with vesSendStatus = 'failed'"); + return map; + } + public String retrieveAlarmConditionFromMap(String key){ + List<JsonAlarmStorage> value; + System.out.println("retriving alarm condition from map"); + if (map.containsKey(key)) { + value = map.get(key); + //System.out.println("Key : " + key +" value :"+ value); + return value.get(0).alarm; + } + return "uuid not found"; + } + + public String retrieveVesSendStatusFromMap(String key){ + List<JsonAlarmStorage> value; + log.info("retriving alarm condition from map"); + if (map.containsKey(key)) { + value = map.get(key); + //System.out.println("Key : " + key +" value :"+ value); + return value.get(0).vesSendStatus; + } + return "uuid not found"; + } + + public JSONObject retrieveJsonFromMap(String key){ + List<JsonAlarmStorage> value; + log.info("retriving json from map"); + if (map.containsKey(key)) { + value = map.get(key); + //System.out.println("Key : " + key +" value :"+ value); + return value.get(0).json; + } + return null; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public JSONObject retrieveALLFromMapBatch(){ + log.info("Encoding and retriving json for batch"); + JSONObject eventList = new JSONObject(); + JSONArray list = new JSONArray(); + Iterator i = map.keySet().iterator(); + while(i.hasNext()) + { + String key = i.next().toString(); + List<JsonAlarmStorage> value = map.get(key); + String value1=value.get(0).alarm+""+value.get(0).json.toString() ; + log.info("Key : " + key +" value :"+ value.get(0).alarm+""+value.get(0).json); + JSONObject json = value.get(0).json; + log.info(line); + log.info(json.get("event").toString()); + JSONObject obj = (JSONObject) json.get("event"); + list.add(obj); + } + log.info(line); + eventList.put("eventList", list); + log.info(eventList.toString()); + log.info(line); + return eventList; + } + + + @SuppressWarnings("rawtypes") + public void displayAllEntriesInMap(){ + log.info("retrive all from map"); + Iterator i = map.keySet().iterator(); + String mapValues; + while(i.hasNext()){ + String key = i.next().toString(); + List<JsonAlarmStorage> value = map.get(key); + mapValues = "uuid: "+key+" jsonStructure: "+value.get(0).json.toString()+" AlarmCondition: "+value.get(0).alarm+": VesSend status: "+value.get(0).vesSendStatus; + log.info(mapValues); + } + } + + public void deleteFromMap(String key){ + log.info("deleting json from map"); + map.remove(key); + log.info("values of key "+key+" deleted successfully"); + } + + @SuppressWarnings("rawtypes") +public void deleteUsingAlarmCondition(String alarm){ + Iterator it = map.entrySet().iterator(); + while (it.hasNext()) + { + Entry item = (Entry) it.next(); + System.out.println(item.getKey());; + List<JsonAlarmStorage> value = map.get(item.getKey()); + if(value.get(0).alarm == alarm) + { + it.remove(); + log.info("removed.."); + } + } + log.info("removed"); +} + + + + + public void deleteAllFromMap(){ + log.info("clearing map"); + map.clear(); + log.info("map cleared.."); + log.info(map.toString()); + } + + public int totalEntriesInMap(){ + log.info("Total entries in map", map.size()); + return map.size(); + } + + public boolean isJsonFound(String key){ + log.info("checking uuid in map"); + if(map.containsKey(key)) + { + return true; + } + return false; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/ReadPropertiesFile.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/ReadPropertiesFile.java new file mode 100644 index 0000000..9a96c2c --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/ReadPropertiesFile.java @@ -0,0 +1,49 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ReadPropertiesFile { + private final Logger log = LoggerFactory.getLogger(ReadPropertiesFile.class); + public boolean readProperties(VsphereEntity vsphereEntity,String filePath){ + try { + File file = new File(filePath); + FileInputStream fileInput = new FileInputStream(file); + Properties properties = new Properties(); + properties.load(fileInput); + fileInput.close(); + if( properties.getProperty("Path_VspherePython").isEmpty() || properties.getProperty("Python_Output_Json").isEmpty()){ + log.info("Provide python path and json path in Agent.properties file"); + return false; + }else{ + vsphereEntity.setPathVspherePython(properties.getProperty("Path_VspherePython")); + vsphereEntity.setPythonOutputJson(properties.getProperty("Python_Output_Json")); + return true; + } + } + catch(Exception e){ + log.info("Agent.properties file doen't have appropriate values or the file is empty Please modify Agent.properties!"); + log.error("error",e); + + } + + return false; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java new file mode 100644 index 0000000..db8e580 --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java @@ -0,0 +1,188 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import java.io.IOException; +import java.net.Socket; +import java.util.List; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.json.simple.JSONObject; +import org.json.simple.parser.ParseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/*Contain all methods for rest api calls*/ +@SuppressWarnings("deprecation") +public class VESRestAPI{ + String eventType; + int counter_connectionRefused = 0; + private StringEntity entity; + private HttpPost post; + private Socket sock; + private DefaultHttpClient client; + private final Logger log = LoggerFactory.getLogger(VESRestAPI.class); + private String applicationJson = "application/json"; + private String anyEvent = "any"; + private String batchEvent = "batch"; + private String vesSendStatusSuccess="success"; + @SuppressWarnings({ "resource" }) + public boolean publishAnyEventToVES(VesEntity ves ,JsonStoreMap map, VesTimer timer,String uuidKey,List<JsonAlarmStorage> list, Integer duration,String vesSendStatus) throws IOException{ + try{ + eventType = anyEvent; + log.info("inside publish any event method"); + sock = new Socket(ves.getVesip(), ves.getPort()); + log.info(String.valueOf(sock.isConnected())); + if(sock.isConnected()){ + log.info("list "+list.get(0).json.toString()); + client = new DefaultHttpClient(); + /* check the vesStructure whether each of the variable like ip address , portnumber , user name and password contains something or is null */ + if(vesEntitycredentialCheckSuccess(ves)){ + post = new HttpPost("http://"+ves.getVesip()+":"+ves.getPort()+"/eventListener/v5"); + log.info(ves.getPort().toString()); + }else{ + log.info("Null"); + } + entity = new StringEntity(list.get(0).json.toString()); + post.setEntity(entity); + post.setHeader("Content-type", applicationJson); + HttpResponse response = client.execute(post); + log.info(response.getStatusLine().toString()); + if(vESCollectorSendStatus(response,map,uuidKey,list,timer,vesSendStatus)){ + return true; + } + sock.close(); + client.close(); + } + }catch(Exception e){ + log.info("VES Collector connection refused exception error occured"); + log.error("error",e); + list.get(0).vesSendStatus = "failed"; + map.updateMap(uuidKey, list); + if (!timer.isTimerRunning()){ + timer.startTimer(duration); + } + else log.info("VES Collector Connection Refushed Timer is running "); +} + return false; + +} + + @SuppressWarnings("resource") + public boolean publishBatchEventToVES(VesEntity ves, JSONObject alarmJsonConstructArray,JsonStoreMap map, VesTimer timer,String uuidKey,List<JsonAlarmStorage> list, Integer duration,String vesSendStatus) throws IOException{ + try { + eventType = batchEvent; + log.info("inside publish batch event method"); + sock = new Socket(ves.getVesip(), ves.getPort()); + if(sock.isConnected()){ + log.info("Sending batch"); + client = new DefaultHttpClient(); + if(vesEntitycredentialCheckSuccess(ves)) + { + post = new HttpPost("http://"+ves.getVesip()+":"+ves.getPort()+"/eventListener/v5/eventBatch"); + }else{ + log.info("Null"); + } + entity = new StringEntity(alarmJsonConstructArray.toJSONString()); + post.setEntity(entity); + post.setHeader("Content-type", applicationJson); + post.addHeader("Accept", applicationJson); + HttpResponse response = client.execute(post); + log.info(response.getStatusLine().toString()); + if(!connectionRefused(response)){ + return true; + } + + if(vESCollectorSendStatus(response,map,uuidKey,list,timer,vesSendStatus)){ + return true; + } + } + sock.close(); + client.close(); + }catch(Exception e){ + log.info("connection refused exception error occured"); + log.error("error",e); + list.get(0).vesSendStatus = "failed"; + map.updateMap(uuidKey, list); //modifying map with vesSendStatus as failed + log.info("..."); + if (!timer.isTimerRunning()){ + log.info("timer started...."); + timer.startTimer(duration); + } + else{ + log.info("Connection refused timer is running"); + } + } + return false; + } + public boolean vesEntitycredentialCheckSuccess(VesEntity ves){ + if(ves.getPort()==null || ves.getVesip()==null || ves.getVesPassword()==null || ves.getVesUsername()==null){ + return false; + } + return true; + } + +public boolean vESCollectorSendStatus ( HttpResponse response,JsonStoreMap map,String uuidKey, List<JsonAlarmStorage> list,VesTimer timer,String vesSendStatus) throws ParseException { + + JsonAlarmStorage store = list.get(0); + log.info(String.valueOf(list.size())); + log.info(store.alarm); + String alarmStatus = store.alarm; + log.info("insiide ves collector method"); + if(response.getStatusLine().getStatusCode()>=200 && response.getStatusLine().getStatusCode()<300){ + log.info("..........."); + if(alarmStatus == "ON" && eventType==anyEvent){ + log.info("alarm on ,event type is any and connection is 200 ok"); + log.info("Test list for satus"+list.get(0).vesSendStatus); + log.info("total entrie sin map: ",map.totalEntriesInMap()); + map.displayAllEntriesInMap(); + list.get(0).vesSendStatus = vesSendStatusSuccess; + map.updateMap(uuidKey, list); + }else if(alarmStatus == "ON" && eventType==batchEvent){ + log.info("alarm on ,event type is any and connection is 200 ok"); + log.info("Test list for satus"+list.get(0).vesSendStatus); + log.info("total entrie:",map.totalEntriesInMap()); + map.displayAllEntriesInMap(); + map.updateMapBatch("success"); + }else if (alarmStatus == "OFF" && (vesSendStatus=="new" || vesSendStatus ==vesSendStatusSuccess) && eventType==anyEvent){ + log.info("alarm off and connection ok"); + map.deleteFromMap(uuidKey); + } else if(alarmStatus == "OFF" && (vesSendStatus=="new" || vesSendStatus ==vesSendStatusSuccess) && eventType==batchEvent){ + log.info("alarm off and connection ok"); + map.deleteUsingAlarmCondition(alarmStatus); + } + + if(timer.isTimerRunning()){ + timer.stopTimer(); + } + else{ + log.info("timer is not running...."); + } + return true; + } + else + { + log.info("connection error !200"); + return false; + } + } + public boolean connectionRefused(HttpResponse response){ + if(response.getStatusLine().getStatusCode()!=200){ + return true; + } + return false; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesAgent.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesAgent.java new file mode 100644 index 0000000..e5ad34f --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesAgent.java @@ -0,0 +1,226 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import java.io.FileReader; +import java.util.List; +import java.text.DateFormat; +import java.util.Date; +import java.util.Locale; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.log4j.BasicConfigurator; +public class VesAgent { + private static final Logger log = LoggerFactory.getLogger(VesAgent.class); + private static final String ERROR = "error"; + private VesAgent(){ + + } + public static void main (String[] args ) throws InterruptedException { + BasicConfigurator.configure(); + + if (args.length < 1 ) + { + log.info("Invalid Number of Arugments , provide the agent properties file path! " ); + return; + } + else + { + try { + /* in the VShpere Entity we are storing the VCentre IP Address + * , user name , + * password , vmname + */ + + int count = 0; + VsphereDataEntity vsphereDataEntity = new VsphereDataEntity(); + JsonStoreMap map = new JsonStoreMap(); + List<JsonAlarmStorage> list; + JSONParser parser = new JSONParser(); + Integer duration = 120000; + log.info("inside main method"); + String alarmCondition; // for checking alarm is raised or not + String vesSendStatus = "new"; //vesSendStatus + String filePath=args[0]; + /* VSphereData contains all method to connect , + * retrieve and + * fetch data using VShpere API + */ + VsphereData vsphereData = new VsphereData(); + VsphereEntity vsphereEntity = new VsphereEntity(); + VesEntity vesEntity = new VesEntity(); + ReadPropertiesFile file = new ReadPropertiesFile(); + if(file.readProperties(vsphereEntity,filePath) && getEnv(vsphereEntity, vesEntity)) + { + VESRestAPI vesRestAPI= new VESRestAPI(); + JSONObject eventObj = new JSONObject(); + JSONObject event = new JSONObject(); + JSONObject commonEventHeader = new JSONObject(); + JSONObject faultFields = new JSONObject(); + VesTimer timer = new VesTimer(map); + int i=0; + while(true) + { + /* In this we are calling pyvmomi sdk via python to get the list of VM + * containing instanceUUID and heartbeatstatus for each VM into a JSON File */ + log.info("timer before running python"+getDateTime()); + Runtime rt = Runtime.getRuntime(); + log.info("Execute Python File: " + vsphereEntity.getPathVspherePython()); + Process p = rt.exec("python "+vsphereEntity.getPathVspherePython()+" -s "+vsphereEntity.getVsphereServerName()+" -u "+vsphereEntity.getVsphereUsername()+" -p "+vsphereEntity.getVsperePassword()); + int result=p.waitFor(); + if(result == 0){ + System.out.println("......done..json..."); + Thread.sleep(5000); + log.info("JSON File Path: " + vsphereEntity.getPythonOutputJson()); + /* Here we are opening the JSON File + * and iterating and fetching the indivudal VM details and deciding the logic of raising the alarm on/off */ + Object obj = parser.parse(new FileReader(vsphereEntity.getPythonOutputJson())); + JSONArray jsonObject = (JSONArray) obj; + log.info(jsonObject.toJSONString()); + log.info("inside while loop"); + for(int j = 0;j<=jsonObject.size()-1;j++){ + log.info("timer is running or not: "+timer.isTimerRunning()); + log.info("Is timed out happn: "+timer.isTimeout()); + JSONObject js = (JSONObject) jsonObject.get(j); + log.info(""); + log.info(js.toJSONString()); + count++; + log.info("////////////////////////////////////////////////////////////////////////////"); + log.info("map entries in total"+map.totalEntriesInMap()); + log.info("Count:"+count); + VsphereDataEntity entity = vsphereData.gettingVMInfo(js,vsphereDataEntity,vsphereEntity); + String heartBeatStatus = vsphereDataEntity.getStatus(); + log.info(heartBeatStatus); + + String uuid_key = vsphereDataEntity.getSourceId(); + if(heartBeatStatus!="green"){ + //encode json + if(map.isJsonFound(uuid_key) && map.retrieveAlarmConditionFromMap(uuid_key) == "ON"){ + log.info("alarm ON already raised"); + } + else if(!map.isJsonFound(uuid_key)){ + alarmCondition = "ON"; + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + log.info(list.get(0).json+" :"+list.get(0).alarm+" :"+list.get(0).vesSendStatus); + map.addToMap(uuid_key, list); + + if(map.totalEntriesInMap()>1) + { + JSONObject alarmJsonConstructArray = map.retrieveALLFromMapBatch(); + vesRestAPI.publishBatchEventToVES(vesEntity, alarmJsonConstructArray, map, timer, uuid_key, list, duration , vesSendStatus); + } + else + { + //map.addToMap(uuid_key, list); + //vesRestAPI.publishAnyEventToVES(vesEntity, event,null,map, timer); + vesRestAPI.publishAnyEventToVES(vesEntity,map, timer,uuid_key, list,duration,vesSendStatus); + log.info("published "); + + } + } + } + else if(heartBeatStatus == "green"){ + /* if the alarm on entry is found in Map then check for the vesSendStatus + * IF the VesSendStatus ==failed for Alarm On + * in the case remove the entries from MAP and + * donot encode the alarm off and donot send it to VESCollector */ + if((map.isJsonFound(uuid_key) && map.retrieveAlarmConditionFromMap(uuid_key) == "ON") && map.retrieveVesSendStatusFromMap(uuid_key)!="failed"){ + alarmCondition = "OFF"; + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + String json = event.toJSONString(); + log.info(json); + map.addToMap(uuid_key, list); + + if(map.totalEntriesInMap()>1){ + //sending only entry having vesSendStatus = failed + JSONObject alarmJsonConstructArray = map.retrieveALLFromMapBatch(); + vesRestAPI.publishBatchEventToVES(vesEntity, alarmJsonConstructArray, map, timer, json, list, duration,vesSendStatus); + } + else{ + vesRestAPI.publishAnyEventToVES(vesEntity,map, timer,uuid_key,list,duration,vesSendStatus); + } + } + else{ + log.info("ALarm ON not found, ves Send status is failed"); + } + } + Thread.sleep(2000); + log.info("for loop end..."); + } + log.info(String.valueOf(count)); + + }else if(result!=0){ + log.info("Something went wrong on fetching info using python script!! Check the python script and credentials"); + break; + } + i++; + if (i == Integer.MIN_VALUE) { // true at Integer.MAX_VALUE +1 + break; + } + } + }else{ + log.info("Missing values for python files - Env Variabl es "); + + } + } catch(java.io.FileNotFoundException e){ + log.info("File not found exception. Check the json file path"); + log.error(ERROR,e); + } + catch (IOException e) { + log.info("Something went wrong with python in runtime"); + log.error(ERROR,e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + log.info("Interupted exception occured. Python script execution taking more time"); + log.error(ERROR,e); + } catch (ParseException e) { + log.info("Something went wrong with json created by python! Parse exception occured"); + log.error(ERROR,e); + }catch (Exception e) { + log.info("Exception Occured!!"); + log.error(ERROR,e); + } } + } + public static String getDateTime(){ + DateFormat df = DateFormat.getDateTimeInstance (DateFormat.MEDIUM, DateFormat.MEDIUM, new Locale ("en", "EN")); + return df.format (new Date ()); + } +public static boolean getEnv(VsphereEntity vsphereEntity, VesEntity vesEntity){ + try{ + if(System.getenv("Vsphere_Ip").isEmpty() || System.getenv("Vsphere_Username").isEmpty() || System.getenv("Vsphere_Password")==null || System.getenv("VesCollector_Ip").isEmpty() || System.getenv("VesCollector_Port").isEmpty()){ + log.info("Null values"); + return false; + } + else{ + vsphereEntity.setVsphereServerName(System.getenv("Vsphere_Ip")); + vsphereEntity.setVsphereUsername(System.getenv("Vsphere_Username")); + vsphereEntity.setVsperePassword(System.getenv("Vsphere_Password")); + vesEntity.setVesip(System.getenv("VesCollector_Ip")); + vesEntity.setVesPassword(System.getenv("VesCollector_Port")); + return true; + + } + }catch(NullPointerException e){ + log.error("Missing values - env var",e); + } + return false; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesEntity.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesEntity.java new file mode 100644 index 0000000..1f3e863 --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesEntity.java @@ -0,0 +1,48 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; +/*Entity class for ves ip + * port + * username + * password*/ +public class VesEntity { + private String vesip; + private Integer port; + private String vesUsername; + private String vesPassword; + public String getVesip() { + return vesip; + } + public void setVesip(String vesip) { + this.vesip = vesip; + } + public Integer getPort() { + return port; + } + public void setPort(Integer port) { + this.port = port; + } + public String getVesUsername() { + return vesUsername; + } + public void setVesUsername(String vesUsername) { + this.vesUsername = vesUsername; + } + public String getVesPassword() { + return vesPassword; + } + public void setVesPassword(String vesPassword) { + this.vesPassword = vesPassword; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesTimer.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesTimer.java new file mode 100644 index 0000000..acdca74 --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VesTimer.java @@ -0,0 +1,95 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import java.util.Timer; +import java.util.TimerTask; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +class TimerExtend extends Timer{ + + public TimerExtend(){ + VesTimer.hasStarted = true; + } + + public boolean hasRunStarted() { + return VesTimer.hasStarted; + } +} + +class TaskTimeout extends TimerTask{ + private static JsonStoreMap map; + private final Logger log = LoggerFactory.getLogger(TaskTimeout.class); + @SuppressWarnings("static-access") + public TaskTimeout(JsonStoreMap map) { + TaskTimeout.map = map; + } + + public static void run1(){ + VesTimer.timeoutCheck = true; + map.deleteAllFromMap(); + VesTimer.hasStarted=false; + } + @SuppressWarnings("resource") + @Override + public void run() { + run1(); + log.info("In Time out before deleting the entries from Map"); + + } +} + +public class VesTimer { + TimerExtend tt = null; + TaskTimeout timeout = null; + static boolean hasStarted = false; + static boolean timeoutCheck = false; + private JsonStoreMap map; + private final Logger log = LoggerFactory.getLogger(VesTimer.class); + public VesTimer(JsonStoreMap map){ + this.map = map; + } + + public void startTimer(Integer duration){ + tt = new TimerExtend(); + timeout= new TaskTimeout(this.map); + log.info("timer started................."); + tt.schedule(timeout, duration); + } + + public void stopTimer(){ + tt.cancel(); + log.info("timer stopped"); + } + + public boolean isTimerRunning(){ + if(VesTimer.hasStarted == true){ + log.info("timer started...."); + return true; + } + else { + log.info("timer is not running"); + return false; + } +} + public String isTimeout(){ + if(VesTimer.timeoutCheck){ + log.info("expired"); + return "expired"; + } + return "not expired"; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java new file mode 100644 index 0000000..0c56c2d --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java @@ -0,0 +1,158 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.json.simple.JSONObject; + +public class VsphereData { + private final Logger log = LoggerFactory.getLogger(VsphereData.class); + public VsphereDataEntity gettingVMInfo(JSONObject js,VsphereDataEntity vsphereDataEntity,VsphereEntity vsphereEntity){ + String vsphereVMname = (String) js.get("Name"); + vsphereEntity.setVsphereVMname(vsphereVMname); + vsphereDataEntity.setSourceName(vsphereVMname); + String status = (String) js.get("Heartbeatstatus"); + vsphereDataEntity.setStatus(status.toString()); + + String instance_uuid=(String) js.get("Instance UUID"); + vsphereDataEntity.setSourceId(instance_uuid); + + String sourceType="VirtualMachine"; + vsphereDataEntity.setSourceType(sourceType); + + log.info(vsphereDataEntity.getSourceName()); + log.info(vsphereDataEntity.getSourceId()); + + log.info(vsphereDataEntity.getStatus()); + log.info(vsphereDataEntity.getSourceType()); + + return vsphereDataEntity; + } + + + @SuppressWarnings("unchecked") + public void encodeJson(VsphereDataEntity vsphereDataEntity,JSONObject event, JSONObject eventObj,JSONObject commonEventHeader,JSONObject faultFields, JsonStoreMap map) { + log.info("encoding to json......."); + Double version = 3.0; + String domain="fault"; + + UUID uuid = UUID.randomUUID(); + + + //String eventId = "ab305d54-85b4-a31b-7db2-fb6b9e546015"; + String sourceName=vsphereDataEntity.getSourceName(); + String reportingEntityName = "Multi-Cloud"; + Integer sequence=0; + //String eventType="GuestOS"; + String eventName=""; + String priority=""; + String eventSeverity=""; + String alarmCondition=""; + String vfStatus=""; + String specificProblem=""; + long unixTime = (System.currentTimeMillis() / 1000L)*1000000 ; + Long startEpochMicrosec = null; + Long lastEpochMicrosec = null; + String eventId=""; + String sourceId =vsphereDataEntity.getSourceId().toString(); + Double faultFieldsVersion=2.0; + if (vsphereDataEntity.getStatus() !="green") { + eventName="Fault_MultiCloud_VMFailure"; + priority="High"; + eventSeverity="CRITICAL" ; //it should be in caps + alarmCondition="Guest_Os_Failure"; + vfStatus="Active"; + specificProblem="AlarmOn"; + startEpochMicrosec = unixTime; + lastEpochMicrosec = unixTime; + eventId = uuid.toString(); + } + else { + eventName="Fault_MultiCloud_VMFailureCleared"; + priority="Normal"; + eventSeverity="Normal" ; + alarmCondition="Vm_Restart"; + vfStatus="Active"; + specificProblem="AlarmOff"; + + JSONObject json = map.retrieveJsonFromMap(sourceId); + JSONObject e1 = (JSONObject) json.get("event"); + JSONObject c1 =(JSONObject) e1.get("commonEventHeader"); + String eventIdRetrieved = (String) c1.get("eventId"); + Long startEpochMicrosecRetrieved = (Long) c1.get("startEpochMicrosec"); + + startEpochMicrosec = startEpochMicrosecRetrieved; + lastEpochMicrosec = unixTime; + eventId=eventIdRetrieved; + } + /* Point to be noted for start and last epoch time - + for alarm on case both will be the same value + but for alarm off case the lastEpochMicroSec will be current System/Date/Time */ + + + //here we have to create jsonobjects + //JSONObject commonEventHeader = new JSONObject(); + commonEventHeader.put("version", version); + commonEventHeader.put("domain",domain); + commonEventHeader.put("eventName",eventName); + commonEventHeader.put("eventId",eventId); + commonEventHeader.put("sequence",sequence); + commonEventHeader.put("priority",priority); + commonEventHeader.put("reportingEntityName",reportingEntityName); + commonEventHeader.put("sourceId",sourceId); + commonEventHeader.put("sourceName",sourceName); + commonEventHeader.put("startEpochMicrosec",startEpochMicrosec); + commonEventHeader.put("lastEpochMicrosec",lastEpochMicrosec); + + //JSONObject faultFields = new JSONObject(); + faultFields.put("faultFieldsVersion",faultFieldsVersion ); + faultFields.put("eventSeverity",eventSeverity ); + faultFields.put("alarmCondition",alarmCondition ); + faultFields.put("specificProblem",specificProblem ); + faultFields.put("vfStatus",vfStatus ); + faultFields.put("alarmInterfaceA", "aaaa"); + faultFields.put("eventSourceType", "other"); + + //JSONObject eventObj = new JSONObject(); + eventObj.put("commonEventHeader", commonEventHeader); + eventObj.put("faultFields",faultFields); + + //JSONObject event = new JSONObject(); + event.put("event", eventObj); + } + + public List<String> listJsonAlarm(String Json,String alarmCondition){ + System.out.println("adding to list- json and alarm"); + List<String> list = new ArrayList<String>(); + list.add(Json); + list.add(alarmCondition); + return list; + } + + public List<JsonAlarmStorage> listJsonAlarm2(JSONObject json,String alarmCondition, String vesSendStatus){ + log.info("adding to list- json and alarm"); + JsonAlarmStorage store = new JsonAlarmStorage(); + List<JsonAlarmStorage> list = new ArrayList<JsonAlarmStorage>(); + store.json = json; + store.alarm=alarmCondition; + store.vesSendStatus = vesSendStatus; + list.add(store); + return list; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereDataEntity.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereDataEntity.java new file mode 100644 index 0000000..2e747ba --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereDataEntity.java @@ -0,0 +1,45 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +public class VsphereDataEntity { + private String sourceName; + private String sourceType; + private String sourceId; + private String status; + public String getSourceName() { + return sourceName; + } + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + public String getSourceType() { + return sourceType; + } + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + public String getSourceId() { + return sourceId; + } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } +} diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereEntity.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereEntity.java new file mode 100644 index 0000000..809fd78 --- /dev/null +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereEntity.java @@ -0,0 +1,59 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + +public class VsphereEntity { + private String VsphereServerName; + private String VsphereUsername; + private String VsperePassword; + private String VsphereVMname; + private String PathVspherePython; + private String PythonOutputJson; + + public String getVsphereUsername() { + return VsphereUsername; + } + + public void setVsphereUsername(String vsphereUsername) { + this.VsphereUsername = vsphereUsername; + } + + public String getPythonOutputJson() { + return PythonOutputJson; + } + public void setPythonOutputJson(String pythonOutputJson) { + PythonOutputJson = pythonOutputJson; + } + public String getPathVspherePython() { + return PathVspherePython; + } + public void setPathVspherePython(String pathVspherePython) { + PathVspherePython = pathVspherePython; + } + public String getVsperePassword() { + return VsperePassword; + } + public void setVsperePassword(String vsperePassword) { + VsperePassword = vsperePassword; + } + public void setVsphereVMname(String vsphereVMname) { + VsphereVMname = vsphereVMname; + } + public String getVsphereServerName() { + return VsphereServerName; + } + public void setVsphereServerName(String vsphereServerName) { + VsphereServerName = vsphereServerName; + } +} diff --git a/vesagent/src/test/java/org/onap/multicloud/openstack/vmware/VesAgentTest.java b/vesagent/src/test/java/org/onap/multicloud/openstack/vmware/VesAgentTest.java new file mode 100644 index 0000000..b73958a --- /dev/null +++ b/vesagent/src/test/java/org/onap/multicloud/openstack/vmware/VesAgentTest.java @@ -0,0 +1,349 @@ + /* Copyright (c) 2017 VMware, Inc. + * + * 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. + */ + +package org.onap.multicloud.openstack.vmware; + + +import static org.junit.Assert.*; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.List; + +import org.apache.http.client.ClientProtocolException; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +//import org.json.JSONObject; +//import com.google.gson.JsonParser; +//import com.google.gson.JsonObject; +import org.junit.Test; + + + + +/* +public class VesAgent { + static int count = 0; + static VsphereDataEntity vsphereDataEntity = new VsphereDataEntity(); + static JsonStoreMap map = new JsonStoreMap(); + static List<JsonAlarmStorage> list; + static JSONParser parser = new JSONParser(); + + public static void main(String[] args) { + if (args.length < 1 ) + { + System.out.println("Invalid Number of Arugments , provide the agent properties file path! " ); + return; + } + else + { + try { + // in the VShpere Entity we are storing the VCentre IP Address + // , user name , + // password , vmname + // + Integer duration = 120000; + System.out.println("inside main method"); + String alarmCondition = "OFF"; // for checking alarm is raised or not + String vesSendStatus = "new"; //vesSendStatus + String filePath=args[0]; + + // VSphereData contains all method to connect , + // retrieve and + // fetch data using VShpere API + // + + VsphereData vsphereData = new VsphereData(); + VsphereEntity vsphereEntity = new VsphereEntity(); + VesEntity vesEntity = new VesEntity(); + ReadPropertiesFile file = new ReadPropertiesFile(); + if(file.readProperties(vsphereEntity, vesEntity, filePath)) + { + VESRestAPI vesRestAPI= new VESRestAPI(); + JSONObject eventObj = new JSONObject(); + JSONObject event = new JSONObject(); + JSONObject commonEventHeader = new JSONObject(); + JSONObject faultFields = new JSONObject(); + VesTimer timer = new VesTimer(vesEntity, map, vesRestAPI); + while(true) + { + // In this we are calling pyvmomi sdk via python to get the list of VM + // containing instanceUUID and heartbeatstatus for each VM into a JSON File + Runtime rt = Runtime.getRuntime(); + Process p = rt.exec("python "+vsphereEntity.getPathVspherePython()+" -s "+vsphereEntity.getVsphereServerName()+" -u "+vsphereEntity.getVsphereUsername()+" -p "+vsphereEntity.getVsperePassword()); + System.out.println("......done..json..."); + Thread.sleep(5000); + + // Here we are opening the JSON File + // and iterating and fetching the indivudal VM details and deciding the logic of raising the alarm on/off + Object obj = parser.parse(new FileReader(vsphereEntity.getPythonOutputJson())); + JSONArray jsonObject = (JSONArray) obj; + System.out.println(jsonObject.toJSONString()); + System.out.println("inside while loop"); + for(int j = 0;j<=jsonObject.size()-1;j++){ + System.out.println("timer is running or not: "+timer.isTimerRunning()); + System.out.println("Is timed out happn: "+timer.isTimeout()); + JSONObject js = (JSONObject) jsonObject.get(j); + System.out.println(""); + System.out.println(js.toJSONString()); + count++; + System.out.println("////////////////////////////////////////////////////////////////////////////"); + System.out.println("map entries in total"+map.totalEntriesInMap()); + System.out.println("Count:"+count); + VsphereDataEntity entity = vsphereData.gettingVMInfo(js,vsphereDataEntity,vsphereEntity); + String heartBeatStatus = vsphereDataEntity.getStatus(); + System.out.println(heartBeatStatus); + String uuid_key = vsphereDataEntity.getSourceId(); + if(heartBeatStatus!="green"){ + //encode json + if(map.isJsonFound(uuid_key) && map.retrieveAlarmConditionFromMap(uuid_key) == "ON"){ + System.out.println("alarm ON already raised"); + } + else if(!map.isJsonFound(uuid_key)){ + alarmCondition = "ON"; + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + System.out.println(list.get(0).json+" :"+list.get(0).alarm+" :"+list.get(0).vesSendStatus); + map.addToMap(uuid_key, list); + + if(map.totalEntriesInMap()>1) + { + JSONObject alarmJsonConstructArray = map.retrieveALLFromMapBatch(); + vesRestAPI.publishBatchEventToVES(vesEntity, alarmJsonConstructArray, map, timer, uuid_key, list, duration); + } + else + { + //map.addToMap(uuid_key, list); + //vesRestAPI.publishAnyEventToVES(vesEntity, event,null,map, timer); + vesRestAPI.publishAnyEventToVES(vesEntity,map, timer,uuid_key, list,duration,vesSendStatus); + System.out.println("published "); + } + } + } + else if(heartBeatStatus == "green"){ + // if the alarm on entry is found in Map then check for the vesSendStatus + // * IF the VesSendStatus ==failed for Alarm On + // * in the case remove the entries from MAP and + // * donot encode the alarm off and donot send it to VESCollector + if((map.isJsonFound(uuid_key) && map.retrieveAlarmConditionFromMap(uuid_key) == "ON") && map.retrieveVesSendStatusFromMap(uuid_key)!="failed"){ + alarmCondition = "OFF"; + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + String json = event.toJSONString(); + System.out.println(json); + map.addToMap(uuid_key, list); + + if(map.totalEntriesInMap()>1){ + //sending only entry having vesSendStatus = failed + JSONObject alarmJsonConstructArray = map.retrieveALLFromMapBatch(); + vesRestAPI.publishBatchEventToVES(vesEntity, alarmJsonConstructArray, map, timer, json, list, duration); + } + else{ + vesRestAPI.publishAnyEventToVES(vesEntity,map, timer,uuid_key,list,duration,vesSendStatus); + } + } + else{ + System.out.println("ALarm ON not found, ves Send status is failed"); + } + } + Thread.sleep(2000); + System.out.println("for loop end..."); + } + System.out.println(count); + } + } + } + catch(java.io.FileNotFoundException e){ + System.out.println("File not found exception. Check the json file path"); + //e.printStackTrace(); + } + catch (InterruptedException e) { + System.out.println("Intrupted.."); + //.args.e.printStackTrace(); + } catch (Exception e) { + System.out.println("Exception Occured! Error in connection. Something went wrong with vsphere ip,username,password"); + e.printStackTrace(); + } + } + } +} +*/ + +public class VesAgentTest { + + static VsphereDataEntity vsphereDataEntity = new VsphereDataEntity(); + static JsonStoreMap map = new JsonStoreMap(); + static List<JsonAlarmStorage> list; + public static String output; + String alarmCondition = "OFF"; // for checking alarm is raised or not + String vesSendStatus = "new"; //vesSendStatus + + String filepath="src/test/resources/agent.properties"; + public Integer duration=120000; + VsphereData vsphereData = new VsphereData(); + VsphereEntity vsphereEntity = new VsphereEntity(); + VesEntity vesEntity = new VesEntity(); + ReadPropertiesFile file = new ReadPropertiesFile(); + +// file.readProperties(vsphereEntity, vesEntity, filePath); + + VESRestAPI vesRestAPI= new VESRestAPI(); + JSONObject eventObj = new JSONObject(); + JSONObject event = new JSONObject(); + JSONObject commonEventHeader = new JSONObject(); + JSONObject faultFields = new JSONObject(); + VesTimer timer = new VesTimer(map); + + + +public JSONArray getFileAsJsonObject() + { + JSONArray jsonArrayObj = null; + FileReader fr = null; + JSONParser parser = new JSONParser(); + String jsonfilepath="src/test/resources/event4xjson.json"; + try{ + fr = new FileReader ( jsonfilepath ); + Object obj = parser.parse (fr); + jsonArrayObj = (JSONArray) obj; + System.out.println(jsonArrayObj.toJSONString()); + + } + + catch(Exception e){ +System.out.println("Exception while opening the file"); + e.printStackTrace(); +} + finally { + //close the file + if (fr != null) { + try { + fr.close(); + } catch (IOException e) + { + System.out.println("Error closing file reader stream : " +e.toString()); + } + } + } + return jsonArrayObj; +} + + +@Test + //public void testSingleHeartBeat() throws ClientProtocolException, IOException, ParseException + public void testSingleHeartBeat() throws Exception{ + + JSONArray jsonArrayObject = getFileAsJsonObject(); + String output = "true"; + + for(int j = 0;j<=jsonArrayObject.size()-1;j++){ + + JSONObject js = (JSONObject) jsonArrayObject.get(j); + System.out.println(""); + System.out.println(js.toJSONString()); + + VsphereDataEntity entity = vsphereData.gettingVMInfo(js,vsphereDataEntity,vsphereEntity); + String heartBeatStatus = vsphereDataEntity.getStatus(); + System.out.println(heartBeatStatus); + String uuid_key = vsphereDataEntity.getSourceId(); + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + map.addToMap(uuid_key, list); + + vesRestAPI.publishAnyEventToVES(vesEntity,map, timer,uuid_key, list,duration,vesSendStatus); + + output="true"; + } + assertEquals ("true",output); + +} + +@Test + //public void testmultipleHeartbeat() throws FileNotFoundException, IOException, ParseException + public void testmultipleHeartbeat() throws Exception{ + + + String outout = "true"; + JSONArray jsonArrayObject = getFileAsJsonObject(); + + for(int j = 0;j<=jsonArrayObject.size()-1;j++){ + + JSONObject js = (JSONObject) jsonArrayObject.get(j); + System.out.println(""); + System.out.println(js.toJSONString()); + + VsphereDataEntity entity = vsphereData.gettingVMInfo(js,vsphereDataEntity,vsphereEntity); + String heartBeatStatus = vsphereDataEntity.getStatus(); + System.out.println(heartBeatStatus); + String uuid_key = vsphereDataEntity.getSourceId(); + + vsphereData.encodeJson(entity, event, eventObj, commonEventHeader, faultFields,map); + list = vsphereData.listJsonAlarm2(event, alarmCondition,vesSendStatus); + map.addToMap(uuid_key, list); + map.updateMap(uuid_key, list); + + map.updateMapBatch("failed"); + + JSONObject alarmJsonConstructArray = map.retrieveALLFromMapBatch(); + vesRestAPI.publishBatchEventToVES(vesEntity, alarmJsonConstructArray, map, timer, uuid_key, list, duration , vesSendStatus); + output ="true"; + } + assertEquals ("true",output); + } + + + +@Test + //public void testmultipleHeartbeat() throws FileNotFoundException, IOException, ParseException + public void testAlarmMapEntries() throws Exception{ + + + String outout = "true"; + file.readProperties(vsphereEntity, filepath); + JSONArray jsonArrayObject = getFileAsJsonObject(); + + for(int j = 0;j<=jsonArrayObject.size()-1;j++){ + + JSONObject js = (JSONObject) jsonArrayObject.get(j); + System.out.println(""); + System.out.println(js.toJSONString()); + + VsphereDataEntity entity = vsphereData.gettingVMInfo(js,vsphereDataEntity,vsphereEntity); + String heartBeatStatus = vsphereDataEntity.getStatus(); + System.out.println(heartBeatStatus); + String uuid_key = vsphereDataEntity.getSourceId(); + + map.isJsonFound(uuid_key); + map.retrieveAlarmConditionFromMap(uuid_key); + map.retrieveALLFromMapBatch(); + map.retrieveJsonFromMap(uuid_key); + map.retrieveVesSendStatusFromMap(uuid_key); + map.displayAllEntriesInMap(); + map.deleteFromMap(uuid_key); + map.deleteAllFromMap(); + map.deleteUsingAlarmCondition("AlarmOn"); + map.totalEntriesInMap(); + timer.isTimerRunning(); + timer.startTimer(5000); + timer.stopTimer(); + timer.isTimeout(); + output ="true"; + } + assertEquals ("true",output); + } + +} + diff --git a/vesagent/src/test/resources/event4xjson.json b/vesagent/src/test/resources/event4xjson.json new file mode 100644 index 0000000..447375a --- /dev/null +++ b/vesagent/src/test/resources/event4xjson.json @@ -0,0 +1,427 @@ +[ + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + } +]
\ No newline at end of file diff --git a/vesagent/src/test/resources/event4xjson_1_event.json b/vesagent/src/test/resources/event4xjson_1_event.json new file mode 100644 index 0000000..447375a --- /dev/null +++ b/vesagent/src/test/resources/event4xjson_1_event.json @@ -0,0 +1,427 @@ +[ + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + } +]
\ No newline at end of file diff --git a/vesagent/src/test/resources/event4xjson_2_event.json b/vesagent/src/test/resources/event4xjson_2_event.json new file mode 100644 index 0000000..447375a --- /dev/null +++ b/vesagent/src/test/resources/event4xjson_2_event.json @@ -0,0 +1,427 @@ +[ + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + } +]
\ No newline at end of file diff --git a/vesagent/src/test/resources/event4xjson_multi_event.json b/vesagent/src/test/resources/event4xjson_multi_event.json new file mode 100644 index 0000000..447375a --- /dev/null +++ b/vesagent/src/test/resources/event4xjson_multi_event.json @@ -0,0 +1,427 @@ +[ + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + }, + { + "Heartbeatstatus": "gray", + "Instance UUID": "c96367fe-35b8-51be-8391-ea7a1f075cec", + "Name": "ubuntu_14.04b-80G (369dbffd-b575-40fc-93e8-0beeb6aa2c1c)" + } +]
\ No newline at end of file diff --git a/vesagent/tox.ini b/vesagent/tox.ini new file mode 100644 index 0000000..4f9b7ed --- /dev/null +++ b/vesagent/tox.ini @@ -0,0 +1,19 @@ +[tox] +envlist = py27,pep8 +skipsdist = true + +[tox:jenkins] +downloadcache = ~/cache/pip + +[testenv] +deps = + # for unit test + django-nose>=1.4.0 + coverage==4.2 + mock==2.0.0 + unittest_xml_reporting==1.12.0 + -r{toxinidir}/docker/opt/requirements.txt +changedir={toxinidir}/py +commands = + /usr/bin/find . -type f -name "*.py[c|o]" -delete + python test_getAllVmInfo.py -v diff --git a/vesagent/version.properties b/vesagent/version.properties new file mode 100644 index 0000000..7f86aa1 --- /dev/null +++ b/vesagent/version.properties @@ -0,0 +1,13 @@ +# Versioning variables +# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) +# because they are used in Jenkins, whose plug-in doesn't support + +major=1 +minor=1 +patch=0 + +base_version=${major}.${minor}.${patch} + +# Release must be completed with git revision # in Jenkins +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT |