Update docs for elk-client 42/4942/6
authorAMIT M <am00474504@techmahindra.com>
Thu, 1 Aug 2019 10:34:03 +0000 (16:04 +0530)
committerAMIT M <am00474504@techmahindra.com>
Thu, 1 Aug 2019 16:03:58 +0000 (21:33 +0530)
Issue-ID: ACUMOS-3308
- Updated the documentation
- Updated the spring version

Change-Id: I52556e88ed20635118a7bf07216b636f3d685501
Signed-off-by: AMIT M <am00474504@techmahindra.com>
docs/api/elkclient-api-docs-2.2.4.json [new file with mode: 0644]
docs/elkclient-api-developer-guide.rst [new file with mode: 0644]
docs/elkclient-server-api.rst [new file with mode: 0644]
docs/index.rst
docs/release-notes.rst
elk-client/pom.xml
elk-stack/acumos-elk-env.sh

diff --git a/docs/api/elkclient-api-docs-2.2.4.json b/docs/api/elkclient-api-docs-2.2.4.json
new file mode 100644 (file)
index 0000000..e744514
--- /dev/null
@@ -0,0 +1 @@
+{"swagger":"2.0","info":{"description":"Provides create, retrieve, restore and delete snapshot services for  Operations for Elastic stack. ","version":"version not available","title":"Acumos ELk Client REST API","termsOfService":"Terms of service","contact":{"name":"Acumos Team","url":"https://acumos.org/to-be-determined","email":"contact@acumos.org"},"license":{"name":"Apache 2.0 License","url":"http://www.apache.org/licenses/LICENSE-2.0"}},"host":"localhost:9006","basePath":"/elkclient","tags":[{"name":"elastic-search-service-controller","description":"Set of endpoints for Creating, Retrieving, Updating and Deleting Elasticstack data."}],"paths":{"/all/indices":{"get":{"tags":["elastic-search-service-controller"],"summary":"Get all the indices of Elasticstack.","operationId":"getElkIndicesUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/ElasticStackIndices","originalRef":"ElasticStackIndices"}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/all/repositories":{"get":{"tags":["elastic-search-service-controller"],"summary":"Get all the elasticsearch repositories details of Elasticstack.","operationId":"getElkRepositoryUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ElkGetRepositoriesResponse","originalRef":"ElkGetRepositoriesResponse"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/all/snapshot":{"get":{"tags":["elastic-search-service-controller"],"summary":"Get all the elasticsearch snapshot.","operationId":"getElkSnapshotUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ElkSnapshotsResponse","originalRef":"ElkSnapshotsResponse"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/create/repositories":{"post":{"tags":["elastic-search-service-controller"],"summary":"Create Elasticstack repository.","operationId":"createElkRepositoryUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"elkCreateRepositoriesRequest","description":"elkCreateRepositoriesRequest","required":true,"schema":{"$ref":"#/definitions/ElkRepositoriesRequest","originalRef":"ElkRepositoriesRequest"}}],"responses":{"200":{"description":"OK","schema":{"type":"string"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/create/snapshot":{"post":{"tags":["elastic-search-service-controller"],"summary":"Create elasticstack snapshot.","operationId":"createElkSnapshotUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"createSnapshotRequest","description":"createSnapshotRequest","required":true,"schema":{"$ref":"#/definitions/ElkCreateSnapshotRequest","originalRef":"ElkCreateSnapshotRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ElkSnapshotsResponse","originalRef":"ElkSnapshotsResponse"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/delete/indices":{"post":{"tags":["elastic-search-service-controller"],"summary":"Delete elasticstack Indices.","operationId":"deleteElkSnapshotUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"elasticStackIndices","description":"elasticStackIndices","required":true,"schema":{"$ref":"#/definitions/ElasticStackIndices","originalRef":"ElasticStackIndices"}}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/ElasticStackIndices","originalRef":"ElasticStackIndices"}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/delete/repositories":{"post":{"tags":["elastic-search-service-controller"],"summary":"Delete Elasticstack repository.","operationId":"deleteElkRepositoryUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"elkDeleteRepositoriesRequest","description":"elkDeleteRepositoriesRequest","required":true,"schema":{"$ref":"#/definitions/ElkRepositoriesRequest","originalRef":"ElkRepositoriesRequest"}}],"responses":{"200":{"description":"OK","schema":{"type":"string"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/delete/snapshot":{"post":{"tags":["elastic-search-service-controller"],"summary":"Delete elasticstack snapshot.","operationId":"deleteElkSnapshotUsingPOST_1","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"elkDeleteSnapshotRequest","description":"elkDeleteSnapshotRequest","required":true,"schema":{"$ref":"#/definitions/ElkDeleteSnapshotRequest","originalRef":"ElkDeleteSnapshotRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ElkSnapshotsResponse","originalRef":"ElkSnapshotsResponse"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}},"/restore/snapshot":{"post":{"tags":["elastic-search-service-controller"],"summary":"Restore elasticstack snapshot.","operationId":"restoreElkSnapshotUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"elkRestoreSnapshotRequest","description":"elkRestoreSnapshotRequest","required":true,"schema":{"$ref":"#/definitions/ElkRestoreSnapshotRequest","originalRef":"ElkRestoreSnapshotRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ElasticStackIndiceResponse","originalRef":"ElasticStackIndiceResponse"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"deprecated":false}}},"definitions":{"CreateSnapshot":{"type":"object","required":["repositoryName"],"properties":{"indices":{"type":"array","description":"indices names","items":{"type":"string"}},"repositoryName":{"type":"string","example":"logstashBackup","description":"ElasticStack repository name"}},"title":"CreateSnapshot"},"DeleteSnapshot":{"type":"object","required":["repositoryName"],"properties":{"repositoryName":{"type":"string","example":"logstash","description":"ElasticStack repository name"},"snapShotId":{"type":"string","example":"snapshot-2019-03-28t08-53-41","description":"snapshot-2019-03-28t08-53-41"}},"title":"DeleteSnapshot"},"ELkRepositoryMetaData":{"type":"object","properties":{"name":{"type":"string","example":"logstash","description":"ElasticStack repository name"},"settings":{"type":"object","additionalProperties":{"type":"object"}},"type":{"type":"string","example":"fs","description":"ElasticStack repository type"}},"title":"ELkRepositoryMetaData"},"ElasticStackIndiceResponse":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"string"}},"title":"ElasticStackIndiceResponse"},"ElasticStackIndices":{"type":"object","properties":{"indices":{"type":"array","description":"metricbeat-6.2.4-2019.04.04","items":{"type":"string"}}},"title":"ElasticStackIndices"},"ElasticsearchSnapshotsResponse":{"type":"object","properties":{"repositoryName":{"type":"string","example":"logstash","description":"ElasticStack repository name"},"snapshots":{"type":"array","items":{"$ref":"#/definitions/ElkGetSnapshotMetaData","originalRef":"ElkGetSnapshotMetaData"}}},"title":"ElasticsearchSnapshotsResponse"},"ElkCreateSnapshotRequest":{"type":"object","required":["nodeTimeout"],"properties":{"createSnapshots":{"type":"array","description":"CreateSnapshot is required","items":{"$ref":"#/definitions/CreateSnapshot","originalRef":"CreateSnapshot"}},"nodeTimeout":{"type":"string","example":1,"description":"Value numeric values, ideal value is between 1 to 3"}},"title":"ElkCreateSnapshotRequest"},"ElkDeleteSnapshotRequest":{"type":"object","required":["nodeTimeout"],"properties":{"deleteSnapshots":{"type":"array","description":"DeleteSnapshots is required","items":{"$ref":"#/definitions/DeleteSnapshot","originalRef":"DeleteSnapshot"}},"nodeTimeout":{"type":"string","example":1,"description":"Value numeric values, ideal value is between 1 to 3"}},"title":"ElkDeleteSnapshotRequest"},"ElkGetRepositoriesResponse":{"type":"object","properties":{"repositories":{"type":"array","items":{"$ref":"#/definitions/ELkRepositoryMetaData","originalRef":"ELkRepositoryMetaData"}}},"title":"ElkGetRepositoriesResponse"},"ElkGetSnapshotMetaData":{"type":"object","properties":{"endTime":{"type":"string","example":"2019-03-28 08-53-41","description":"2019-03-28 08-53-41"},"indices":{"type":"array","example":"metricbeat-6.2.4-2019.04.04","description":"metricbeat-6.2.4-2019.04.04","items":{"type":"string"}},"snapShotId":{"type":"string","example":"snapshot-2019-03-28t08-53-41","description":"snapshot-2019-03-28t08-53-41"},"startTime":{"type":"string","example":"2019-03-28 08-53-41","description":"2019-03-28 08-53-41"},"state":{"type":"string","example":"SUCCESS","description":"SUCCESS"},"status":{"type":"string","example":"Snapshot creation is in progress. Will take some time due size of data' or 'OK","description":"Snapshot creation is in progress. Will take some time due size of data or OK"}},"title":"ElkGetSnapshotMetaData"},"ElkRepositoriesRequest":{"type":"object","required":["repositoryName"],"properties":{"nodeTimeout":{"type":"string"},"repositoryName":{"type":"string","example":"logstash","description":"ElasticStack repository name"}},"title":"ElkRepositoriesRequest"},"ElkRestoreSnapshotRequest":{"type":"object","required":["nodeTimeout","repositoryName"],"properties":{"nodeTimeout":{"type":"string","example":1,"description":"Value numeric values, ideal value is between 1 to 3"},"repositoryName":{"type":"string","example":"logstash","description":"ElasticStack repository name"},"restoreSnapshots":{"type":"array","description":"RestoreSnapshot is required","items":{"$ref":"#/definitions/RestoreSnapshot","originalRef":"RestoreSnapshot"}}},"title":"ElkRestoreSnapshotRequest"},"ElkSnapshotsResponse":{"type":"object","properties":{"elasticsearchSnapshots":{"type":"array","items":{"$ref":"#/definitions/ElasticsearchSnapshotsResponse","originalRef":"ElasticsearchSnapshotsResponse"}}},"title":"ElkSnapshotsResponse"},"RestoreSnapshot":{"type":"object","properties":{"snapshotName":{"type":"string"}},"title":"RestoreSnapshot"}}}
\ No newline at end of file
diff --git a/docs/elkclient-api-developer-guide.rst b/docs/elkclient-api-developer-guide.rst
new file mode 100644 (file)
index 0000000..db8bcc8
--- /dev/null
@@ -0,0 +1,112 @@
+.. ===============LICENSE_START=======================================================
+.. Acumos CC-BY-4.0
+.. ===================================================================================
+.. Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
+.. ===================================================================================
+.. This Acumos documentation file is distributed by AT&T and Tech Mahindra
+.. under the Creative Commons Attribution 4.0 International License (the "License");
+.. you may not use this file except in compliance with the License.
+.. You may obtain a copy of the License at
+..
+.. http://creativecommons.org/licenses/by/4.0
+..
+.. This file is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+.. ===============LICENSE_END=========================================================
+
+==============================================
+Developer Guide for the Elastic Client Service 
+==============================================
+
+This microservice provides Backup & Restore services to ELK components in the
+Acumos machine-learning platform. It is built using the Spring-Boot platform.
+This document primarily offers guidance for server developers.
+
+Supported Methods and Objects
+-----------------------------
+
+The microservice endpoints and objects are documented using Swagger. A running
+server documents itself at a URL like the following, but consult the server's
+configuration for the exact port number (e.g., "9006") and context root
+(e.g., "elkclient") to use::
+
+    http://localhost:9006/elkclient/swagger-ui.html
+
+Building and Packaging
+----------------------
+
+As of this writing the build (continuous integration) process is fully automated
+in the Linux Foundation system using Gerrit and Jenkins. This section describes
+how to perform local builds for development and testing.
+
+Prerequisites
+~~~~~~~~~~~~~
+
+The build machine needs the following:
+
+1. Java version 1.8
+2. Maven version 3
+3. Connectivity to Maven Central to download required jars
+
+Use maven to build and package the service into a single "fat" jar using this
+command::
+
+    mvn clean install
+
+Development and Local Testing
+-----------------------------
+
+This section provides information for running the server in a
+production/development environment, assuming that the application is packaged
+into a docker container for deployment.
+
+Prerequisites
+~~~~~~~~~~~~~
+
+    1. Java version 1.8 in the runtime environment; i.e., installed in the
+       docker container
+    2. The username/password combination to access the database
+    3. The Nexus username/password combination to access.
+
+Configuring the system
+~~~~~~~~~~~~~~~~~~~~~~
+
+At runtime in production deployments, in addition to using a configuration file,
+environment-specific configuration properties should be supplied using a block of
+JSON in an environment variable called SPRING\_APPLICATION\_JSON. This can easily
+be done using the deployment templates. The default SV Scanning templates
+for use with docker-compose.
+
+.. code:: bash
+
+   # Get the platform-oam repository 
+   $ git clone https://gerrit.acumos.org/r/platform-oam
+   # Select the Boreas branch
+   cd platform-oam
+   git checkout boreas
+   # See what environment configuration options are supported
+   cat platform-oam/acumos-elk-env.sh
+   # See the docker-compose deployment template with references to options
+   cat platform-oam/docker-compose.yml
+       
+Launch Instructions
+~~~~~~~~~~~~~~~~~~~
+
+To run the elkclient service in a local docker environment:
+
+1. Build an image locally or use an image in the Acumos Nexus repositories.
+
+2. Update environment variables as referenced by the template, either
+   directly or in acumos-elk-env.sh:
+
+   * ACUMOS_ELK_HOST: hostname Acumos elasticsearch.
+   * ELK_CLIENT_CRONSCHEDULE_CREATESNAPSHOT_TIME: Elk client schedule cron job for snapshot creation
+   
+2. Use the docker-compose process that applies to your environment, e.g.
+
+   * for a standalone docker container::
+
+    docker-compose up -d elk-client
+       
\ No newline at end of file
diff --git a/docs/elkclient-server-api.rst b/docs/elkclient-server-api.rst
new file mode 100644 (file)
index 0000000..390162d
--- /dev/null
@@ -0,0 +1,51 @@
+.. ===============LICENSE_START=======================================================
+.. Acumos CC-BY-4.0
+.. ===================================================================================
+.. Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
+.. ===================================================================================
+.. This Acumos documentation file is distributed by AT&T and Tech Mahindra
+.. under the Creative Commons Attribution 4.0 International License (the "License");
+.. you may not use this file except in compliance with the License.
+.. You may obtain a copy of the License at
+..
+.. http://creativecommons.org/licenses/by/4.0
+..
+.. This file is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+.. ===============LICENSE_END=========================================================
+
+==============================
+ELK Client Service Server API
+==============================
+
+This page provides a static view of the methods in the elkclient server.  Please note that a
+running ELK Client server provides a more useful version of this information.  View the details
+at a URL like the following, but check the server configuration for the exact port number
+(e.g., "9006") and context root (e.g., "elkclient") to use::
+
+    http://localhost:9006/elkclient/swagger-ui.html
+       
+Backup & Restore
+----------------
+
+This section list features provided in this services.
+    * Get all the indices present in elastic search.
+    * Get all the repositories information present in elastic search.
+    * Get all the snapshot present in elastic search.
+    * Create elastic search repository.
+    * Create elastic search snapshot.
+    * Delete elastic search Indices.
+    * Delete elastic search repository.
+    * Delete elastic search snapshot.
+    * Restore elastic search snapshot.
+ELK Client APIs in Boreas Release
+---------------------------------
+
+This section lists the methods in version 2.2.4.
+
+.. swaggerv2doc:: api/elkclient-api-docs-2.2.4.json
+
+   
\ No newline at end of file
index c047277..a49a8a2 100644 (file)
@@ -21,10 +21,13 @@ Platform Operations, Administration, and Management (OA&M)
 ==========================================================
 
 .. toctree::
-       :maxdepth: 2
-
-       release-notes
-       developer-guide
-       user-guide
-
+   :maxdepth: 2
+   :caption: Contents:
 
+   release-notes
+   developer-guide
+   user-guide
+   elkclient-api-developer-guide
+   elkclient-server-api
+   
+* :ref:`search`
index c4dd224..e865af1 100644 (file)
@@ -1,7 +1,7 @@
 .. ===============LICENSE_START=======================================================
 .. Acumos
 .. ===================================================================================
-.. Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
+.. Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
 .. ===================================================================================
 .. This Acumos documentation file is distributed by AT&T and Tech Mahindra
 .. under the Creative Commons Attribution 4.0 International License (the "License");
 Platform Operations, Administration, and Management (OA&M) Release Notes
 ========================================================================
 
+Version 2.2.4, 01 August 2019
+-------------------------------
+* Update docs for elk-client (`ACUMOS-3308 <https://jira.acumos.org/browse/ACUMOS-3308>`_)
+
+Version 2.2.3, 11 July 2019
+-------------------------------
+* Platform maintenance support - archival (`ACUMOS-2704 <https://jira.acumos.org/browse/ACUMOS-2704>`_)
+
 Version 2.2.2, 18 April 2019
 -------------------------------
 * Metricbeat index archival/purging (`ACUMOS-2065 <https://jira.acumos.org/browse/ACUMOS-2065>`_)
index c9c961f..6574fb9 100644 (file)
                and limitations under the License. ===============LICENSE_END========================================================= -->
        <modelVersion>4.0.0</modelVersion>
 
-       <groupId>elk-client</groupId>
+       <groupId>org.acumos.elk-client</groupId>
        <artifactId>elk-client</artifactId>
-       <version>0.0.2-SNAPSHOT</version>
+       <version>2.2.4-SNAPSHOT</version>
        <packaging>jar</packaging>
 
        <name>elk-client</name>
-       <description>Elk-Client service </description>
+       <description>Elk-Client service</description>
 
        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
-               <version>2.1.1.RELEASE</version>
+               <version>2.1.4.RELEASE</version>
                <!-- silence warning about parent relative path -->
                <relativePath />
        </parent>
@@ -38,7 +38,7 @@
                <!-- Begin extract of POM file spring-boot-dependencies -->
                <spring.version>5.1.2.RELEASE</spring.version>
                <swagger.version>1.5.21</swagger.version>
-               <springfox.version>2.6.1</springfox.version>
+               <springfox.version>2.9.2</springfox.version>
                <jackson.version>2.9.7</jackson.version>
                <jackson-mapper-asl.version>1.9.9</jackson-mapper-asl.version>
                <json.simple.version>1.1.1</json.simple.version>
                                <!-- <version>1.4.0</version> -->
                        </plugin>
                        <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <!-- <version>3.0</version> -->
                                <configuration>
index 62ba825..749faf5 100644 (file)
@@ -54,4 +54,4 @@ export NEXUS3_RELEASE_REGISTRY_LF=nexus3.acumos.org:10002
 export ELASTICSEARCH_IMAGE=acumos-elasticsearch:2.2.2
 export LOGSTASH_IMAGE=acumos-logstash:2.2.2
 export KIBANA_IMAGE=acumos-kibana:2.2.2
-export ELK_CLIENT=elk-client:0.0.2
+export ELK_CLIENT=elk-client:2.2.4