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 {
33 * "cluster_name" : "docker-cluster",
34 * "cluster_uuid" : "qags6CGGTrS75iBhrAdsgg",
37 * "build_flavor" : "default",
38 * "build_type" : "tar",
39 * "build_hash" : "fe40335",
40 * "build_date" : "2018-10-30T23:17:19.084789Z",
41 * "build_snapshot" : false,
42 * "lucene_version" : "7.4.0",
43 * "minimum_wire_compatibility_version" : "5.6.0",
44 * "minimum_index_compatibility_version" : "5.0.0"
46 * "tagline" : "You Know, for Search"
49 private final String clusterName;
50 private final String name;
52 private final EsVersion version;
53 public GetInfoResponse(Response response) throws Exception {
55 JSONObject o = this.getJson(response);
57 throw new Exception("unable to read response");
59 this.name = o.getString("name");
60 this.clusterName = o.getString("cluster_name");
61 this.version = new EsVersion(o.getJSONObject("version").getString("number"));
63 public String getClusterName() {
66 public String getName() {
69 public EsVersion getVersion() {