2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
24 import org.elasticsearch.client.Response;
25 import org.json.JSONObject;
26 import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion;
28 public class GetInfoResponse extends BaseResponse {
31 * { "name" : "kpOdXt-", "cluster_name" : "docker-cluster", "cluster_uuid" : "qags6CGGTrS75iBhrAdsgg", "version" : {
32 * "number" : "6.4.3", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "fe40335", "build_date" :
33 * "2018-10-30T23:17:19.084789Z", "build_snapshot" : false, "lucene_version" : "7.4.0",
34 * "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" :
35 * "You Know, for Search" }
37 private final String clusterName;
38 private final String name;
40 private final EsVersion version;
42 public GetInfoResponse(Response response) throws Exception {
44 JSONObject o = this.getJson(response);
46 throw new Exception("unable to read response");
48 this.name = o.getString("name");
49 this.clusterName = o.getString("cluster_name");
50 this.version = new EsVersion(o.getJSONObject("version").getString("number"));
53 public String getClusterName() {
57 public String getName() {
61 public EsVersion getVersion() {