All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesAsyncClient Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to Elasticsearch B.V. under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch B.V. licenses this file to you 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.
 */

package co.elastic.clients.elasticsearch.nodes;

import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.Endpoint;
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.util.ObjectBuilder;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import javax.annotation.Nullable;

//----------------------------------------------------------------
//       THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

/**
 * Client for the nodes namespace.
 */
public class ElasticsearchNodesAsyncClient extends ApiClient {

	public ElasticsearchNodesAsyncClient(ElasticsearchTransport transport) {
		super(transport, null);
	}

	public ElasticsearchNodesAsyncClient(ElasticsearchTransport transport,
			@Nullable TransportOptions transportOptions) {
		super(transport, transportOptions);
	}

	@Override
	public ElasticsearchNodesAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
		return new ElasticsearchNodesAsyncClient(this.transport, transportOptions);
	}

	// ----- Endpoint: nodes.clear_repositories_metering_archive

	/**
	 * Clear the archived repositories metering. Clear the archived repositories
	 * metering information in the cluster.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture clearRepositoriesMeteringArchive(
			ClearRepositoriesMeteringArchiveRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) ClearRepositoriesMeteringArchiveRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Clear the archived repositories metering. Clear the archived repositories
	 * metering information in the cluster.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link ClearRepositoriesMeteringArchiveRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture clearRepositoriesMeteringArchive(
			Function> fn) {
		return clearRepositoriesMeteringArchive(
				fn.apply(new ClearRepositoriesMeteringArchiveRequest.Builder()).build());
	}

	// ----- Endpoint: nodes.get_repositories_metering_info

	/**
	 * Get cluster repositories metering. Get repositories metering information for
	 * a cluster. This API exposes monotonically non-decreasing counters and it is
	 * expected that clients would durably store the information needed to compute
	 * aggregations over a period of time. Additionally, the information exposed by
	 * this API is volatile, meaning that it will not be present after node
	 * restarts.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture getRepositoriesMeteringInfo(
			GetRepositoriesMeteringInfoRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) GetRepositoriesMeteringInfoRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Get cluster repositories metering. Get repositories metering information for
	 * a cluster. This API exposes monotonically non-decreasing counters and it is
	 * expected that clients would durably store the information needed to compute
	 * aggregations over a period of time. Additionally, the information exposed by
	 * this API is volatile, meaning that it will not be present after node
	 * restarts.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link GetRepositoriesMeteringInfoRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture getRepositoriesMeteringInfo(
			Function> fn) {
		return getRepositoriesMeteringInfo(fn.apply(new GetRepositoriesMeteringInfoRequest.Builder()).build());
	}

	// ----- Endpoint: nodes.hot_threads

	/**
	 * Get the hot threads for nodes. Get a breakdown of the hot threads on each
	 * selected node in the cluster. The output is plain text with a breakdown of
	 * the top hot threads for each node.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture hotThreads(HotThreadsRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) HotThreadsRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Get the hot threads for nodes. Get a breakdown of the hot threads on each
	 * selected node in the cluster. The output is plain text with a breakdown of
	 * the top hot threads for each node.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link HotThreadsRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture hotThreads(
			Function> fn) {
		return hotThreads(fn.apply(new HotThreadsRequest.Builder()).build());
	}

	/**
	 * Get the hot threads for nodes. Get a breakdown of the hot threads on each
	 * selected node in the cluster. The output is plain text with a breakdown of
	 * the top hot threads for each node.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture hotThreads() {
		return this.transport.performRequestAsync(new HotThreadsRequest.Builder().build(), HotThreadsRequest._ENDPOINT,
				this.transportOptions);
	}

	// ----- Endpoint: nodes.info

	/**
	 * Get node information.
	 * 

* By default, the API returns all attributes and core settings for cluster * nodes. * * @see Documentation * on elastic.co */ public CompletableFuture info(NodesInfoRequest request) { @SuppressWarnings("unchecked") JsonEndpoint endpoint = (JsonEndpoint) NodesInfoRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Get node information. *

* By default, the API returns all attributes and core settings for cluster * nodes. * * @param fn * a function that initializes a builder to create the * {@link NodesInfoRequest} * @see Documentation * on elastic.co */ public final CompletableFuture info( Function> fn) { return info(fn.apply(new NodesInfoRequest.Builder()).build()); } /** * Get node information. *

* By default, the API returns all attributes and core settings for cluster * nodes. * * @see Documentation * on elastic.co */ public CompletableFuture info() { return this.transport.performRequestAsync(new NodesInfoRequest.Builder().build(), NodesInfoRequest._ENDPOINT, this.transportOptions); } // ----- Endpoint: nodes.reload_secure_settings /** * Reload the keystore on nodes in the cluster. *

* Secure settings are stored in an on-disk keystore. Certain of these settings * are reloadable. That is, you can change them on disk and reload them without * restarting any nodes in the cluster. When you have updated reloadable secure * settings in your keystore, you can use this API to reload those settings on * each node. *

* When the Elasticsearch keystore is password protected and not simply * obfuscated, you must provide the password for the keystore when you reload * the secure settings. Reloading the settings for the whole cluster assumes * that the keystores for all nodes are protected with the same password; this * method is allowed only when inter-node communications are encrypted. * Alternatively, you can reload the secure settings on each node by locally * accessing the API and passing the node-specific Elasticsearch keystore * password. * * @see Documentation * on elastic.co */ public CompletableFuture reloadSecureSettings(ReloadSecureSettingsRequest request) { @SuppressWarnings("unchecked") JsonEndpoint endpoint = (JsonEndpoint) ReloadSecureSettingsRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Reload the keystore on nodes in the cluster. *

* Secure settings are stored in an on-disk keystore. Certain of these settings * are reloadable. That is, you can change them on disk and reload them without * restarting any nodes in the cluster. When you have updated reloadable secure * settings in your keystore, you can use this API to reload those settings on * each node. *

* When the Elasticsearch keystore is password protected and not simply * obfuscated, you must provide the password for the keystore when you reload * the secure settings. Reloading the settings for the whole cluster assumes * that the keystores for all nodes are protected with the same password; this * method is allowed only when inter-node communications are encrypted. * Alternatively, you can reload the secure settings on each node by locally * accessing the API and passing the node-specific Elasticsearch keystore * password. * * @param fn * a function that initializes a builder to create the * {@link ReloadSecureSettingsRequest} * @see Documentation * on elastic.co */ public final CompletableFuture reloadSecureSettings( Function> fn) { return reloadSecureSettings(fn.apply(new ReloadSecureSettingsRequest.Builder()).build()); } /** * Reload the keystore on nodes in the cluster. *

* Secure settings are stored in an on-disk keystore. Certain of these settings * are reloadable. That is, you can change them on disk and reload them without * restarting any nodes in the cluster. When you have updated reloadable secure * settings in your keystore, you can use this API to reload those settings on * each node. *

* When the Elasticsearch keystore is password protected and not simply * obfuscated, you must provide the password for the keystore when you reload * the secure settings. Reloading the settings for the whole cluster assumes * that the keystores for all nodes are protected with the same password; this * method is allowed only when inter-node communications are encrypted. * Alternatively, you can reload the secure settings on each node by locally * accessing the API and passing the node-specific Elasticsearch keystore * password. * * @see Documentation * on elastic.co */ public CompletableFuture reloadSecureSettings() { return this.transport.performRequestAsync(new ReloadSecureSettingsRequest.Builder().build(), ReloadSecureSettingsRequest._ENDPOINT, this.transportOptions); } // ----- Endpoint: nodes.stats /** * Get node statistics. Get statistics for nodes in a cluster. By default, all * stats are returned. You can limit the returned information by using metrics. * * @see Documentation * on elastic.co */ public CompletableFuture stats(NodesStatsRequest request) { @SuppressWarnings("unchecked") JsonEndpoint endpoint = (JsonEndpoint) NodesStatsRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Get node statistics. Get statistics for nodes in a cluster. By default, all * stats are returned. You can limit the returned information by using metrics. * * @param fn * a function that initializes a builder to create the * {@link NodesStatsRequest} * @see Documentation * on elastic.co */ public final CompletableFuture stats( Function> fn) { return stats(fn.apply(new NodesStatsRequest.Builder()).build()); } /** * Get node statistics. Get statistics for nodes in a cluster. By default, all * stats are returned. You can limit the returned information by using metrics. * * @see Documentation * on elastic.co */ public CompletableFuture stats() { return this.transport.performRequestAsync(new NodesStatsRequest.Builder().build(), NodesStatsRequest._ENDPOINT, this.transportOptions); } // ----- Endpoint: nodes.usage /** * Get feature usage information. * * @see Documentation * on elastic.co */ public CompletableFuture usage(NodesUsageRequest request) { @SuppressWarnings("unchecked") JsonEndpoint endpoint = (JsonEndpoint) NodesUsageRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Get feature usage information. * * @param fn * a function that initializes a builder to create the * {@link NodesUsageRequest} * @see Documentation * on elastic.co */ public final CompletableFuture usage( Function> fn) { return usage(fn.apply(new NodesUsageRequest.Builder()).build()); } /** * Get feature usage information. * * @see Documentation * on elastic.co */ public CompletableFuture usage() { return this.transport.performRequestAsync(new NodesUsageRequest.Builder().build(), NodesUsageRequest._ENDPOINT, this.transportOptions); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy