
co.elastic.clients.elasticsearch.security.ElasticsearchSecurityAsyncClient Maven / Gradle / Ivy
Show all versions of org.apache.servicemix.bundles.elasticsearch-java
/*
* 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.security;
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.transport.endpoints.BooleanResponse;
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 security namespace.
*/
public class ElasticsearchSecurityAsyncClient
extends
ApiClient {
public ElasticsearchSecurityAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchSecurityAsyncClient(ElasticsearchTransport transport,
@Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchSecurityAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchSecurityAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: security.activate_user_profile
/**
* Activate a user profile.
*
* Create or update a user profile on behalf of another user.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* The calling application must have either an access_token
or a
* combination of username
and password
for the user
* that the profile document is intended for. Elastic reserves the right to
* change or remove this feature in future releases without prior notice.
*
* This API creates or updates a profile document for end users with information
* that is extracted from the user's authentication object including
* username
, full_name,
roles
, and the
* authentication realm. For example, in the JWT access_token
case,
* the profile user's username
is extracted from the JWT token
* claim pointed to by the claims.principal
setting of the JWT
* realm that authenticated the token.
*
* When updating a profile document, the API enables the document if it was
* disabled. Any updates do not change existing content for either the
* labels
or data
fields.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture activateUserProfile(ActivateUserProfileRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ActivateUserProfileRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Activate a user profile.
*
* Create or update a user profile on behalf of another user.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* The calling application must have either an access_token
or a
* combination of username
and password
for the user
* that the profile document is intended for. Elastic reserves the right to
* change or remove this feature in future releases without prior notice.
*
* This API creates or updates a profile document for end users with information
* that is extracted from the user's authentication object including
* username
, full_name,
roles
, and the
* authentication realm. For example, in the JWT access_token
case,
* the profile user's username
is extracted from the JWT token
* claim pointed to by the claims.principal
setting of the JWT
* realm that authenticated the token.
*
* When updating a profile document, the API enables the document if it was
* disabled. Any updates do not change existing content for either the
* labels
or data
fields.
*
* @param fn
* a function that initializes a builder to create the
* {@link ActivateUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture activateUserProfile(
Function> fn) {
return activateUserProfile(fn.apply(new ActivateUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.authenticate
/**
* Authenticate a user.
*
* Authenticates a user and returns information about the authenticated user.
* Include the user information in a
* basic
* auth header. A successful call returns a JSON structure that shows user
* information such as their username, the roles that are assigned to the user,
* any assigned metadata, and information about the realms that authenticated
* and authorized the user. If the user cannot be authenticated, this API
* returns a 401 status code.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture authenticate() {
return this.transport.performRequestAsync(AuthenticateRequest._INSTANCE, AuthenticateRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.bulk_delete_role
/**
* Bulk delete roles.
*
* The role management APIs are generally the preferred way to manage roles,
* rather than using file-based role management. The bulk delete roles API
* cannot delete roles that are defined in roles files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture bulkDeleteRole(BulkDeleteRoleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) BulkDeleteRoleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Bulk delete roles.
*
* The role management APIs are generally the preferred way to manage roles,
* rather than using file-based role management. The bulk delete roles API
* cannot delete roles that are defined in roles files.
*
* @param fn
* a function that initializes a builder to create the
* {@link BulkDeleteRoleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture bulkDeleteRole(
Function> fn) {
return bulkDeleteRole(fn.apply(new BulkDeleteRoleRequest.Builder()).build());
}
// ----- Endpoint: security.bulk_put_role
/**
* Bulk create or update roles.
*
* The role management APIs are generally the preferred way to manage roles,
* rather than using file-based role management. The bulk create or update roles
* API cannot update roles that are defined in roles files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture bulkPutRole(BulkPutRoleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) BulkPutRoleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Bulk create or update roles.
*
* The role management APIs are generally the preferred way to manage roles,
* rather than using file-based role management. The bulk create or update roles
* API cannot update roles that are defined in roles files.
*
* @param fn
* a function that initializes a builder to create the
* {@link BulkPutRoleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture bulkPutRole(
Function> fn) {
return bulkPutRole(fn.apply(new BulkPutRoleRequest.Builder()).build());
}
// ----- Endpoint: security.bulk_update_api_keys
/**
* Bulk update API keys. Update the attributes for multiple API keys.
*
* IMPORTANT: It is not possible to use an API key as the authentication
* credential for this API. To update API keys, the owner user's credentials are
* required.
*
* This API is similar to the update API key API but enables you to apply the
* same update to multiple API keys in one API call. This operation can greatly
* improve performance over making individual updates.
*
* It is not possible to update expired or invalidated API keys.
*
* This API supports updates to API key access scope, metadata and expiration.
* The access scope of each API key is derived from the
* role_descriptors
you specify in the request and a snapshot of
* the owner user's permissions at the time of the request. The snapshot of the
* owner's permissions is updated automatically on every call.
*
* IMPORTANT: If you don't specify role_descriptors
in the request,
* a call to this API might still change an API key's access scope. This change
* can occur if the owner user's permissions have changed since the API key was
* created or last modified.
*
* A successful request returns a JSON structure that contains the IDs of all
* updated API keys, the IDs of API keys that already had the requested changes
* and did not require an update, and error details for any failed update.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture bulkUpdateApiKeys(BulkUpdateApiKeysRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) BulkUpdateApiKeysRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Bulk update API keys. Update the attributes for multiple API keys.
*
* IMPORTANT: It is not possible to use an API key as the authentication
* credential for this API. To update API keys, the owner user's credentials are
* required.
*
* This API is similar to the update API key API but enables you to apply the
* same update to multiple API keys in one API call. This operation can greatly
* improve performance over making individual updates.
*
* It is not possible to update expired or invalidated API keys.
*
* This API supports updates to API key access scope, metadata and expiration.
* The access scope of each API key is derived from the
* role_descriptors
you specify in the request and a snapshot of
* the owner user's permissions at the time of the request. The snapshot of the
* owner's permissions is updated automatically on every call.
*
* IMPORTANT: If you don't specify role_descriptors
in the request,
* a call to this API might still change an API key's access scope. This change
* can occur if the owner user's permissions have changed since the API key was
* created or last modified.
*
* A successful request returns a JSON structure that contains the IDs of all
* updated API keys, the IDs of API keys that already had the requested changes
* and did not require an update, and error details for any failed update.
*
* @param fn
* a function that initializes a builder to create the
* {@link BulkUpdateApiKeysRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture bulkUpdateApiKeys(
Function> fn) {
return bulkUpdateApiKeys(fn.apply(new BulkUpdateApiKeysRequest.Builder()).build());
}
// ----- Endpoint: security.change_password
/**
* Change passwords.
*
* Change the passwords of users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture changePassword(ChangePasswordRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ChangePasswordRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Change passwords.
*
* Change the passwords of users in the native realm and built-in users.
*
* @param fn
* a function that initializes a builder to create the
* {@link ChangePasswordRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture changePassword(
Function> fn) {
return changePassword(fn.apply(new ChangePasswordRequest.Builder()).build());
}
/**
* Change passwords.
*
* Change the passwords of users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture changePassword() {
return this.transport.performRequestAsync(new ChangePasswordRequest.Builder().build(),
ChangePasswordRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.clear_api_key_cache
/**
* Clear the API key cache.
*
* Evict a subset of all entries from the API key cache. The cache is also
* automatically cleared on state changes of the security index.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clearApiKeyCache(ClearApiKeyCacheRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearApiKeyCacheRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clear the API key cache.
*
* Evict a subset of all entries from the API key cache. The cache is also
* automatically cleared on state changes of the security index.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearApiKeyCacheRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clearApiKeyCache(
Function> fn) {
return clearApiKeyCache(fn.apply(new ClearApiKeyCacheRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_privileges
/**
* Clear the privileges cache.
*
* Evict privileges from the native application privilege cache. The cache is
* also automatically cleared for applications that have their privileges
* updated.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clearCachedPrivileges(
ClearCachedPrivilegesRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedPrivilegesRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clear the privileges cache.
*
* Evict privileges from the native application privilege cache. The cache is
* also automatically cleared for applications that have their privileges
* updated.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clearCachedPrivileges(
Function> fn) {
return clearCachedPrivileges(fn.apply(new ClearCachedPrivilegesRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_realms
/**
* Clear the user cache.
*
* Evict users from the user cache. You can completely clear the cache or evict
* specific users.
*
* User credentials are cached in memory on each node to avoid connecting to a
* remote authentication service or hitting the disk for every incoming request.
* There are realm settings that you can use to configure the user cache. For
* more information, refer to the documentation about controlling the user
* cache.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clearCachedRealms(ClearCachedRealmsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedRealmsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clear the user cache.
*
* Evict users from the user cache. You can completely clear the cache or evict
* specific users.
*
* User credentials are cached in memory on each node to avoid connecting to a
* remote authentication service or hitting the disk for every incoming request.
* There are realm settings that you can use to configure the user cache. For
* more information, refer to the documentation about controlling the user
* cache.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedRealmsRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clearCachedRealms(
Function> fn) {
return clearCachedRealms(fn.apply(new ClearCachedRealmsRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_roles
/**
* Clear the roles cache.
*
* Evict roles from the native role cache.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clearCachedRoles(ClearCachedRolesRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedRolesRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clear the roles cache.
*
* Evict roles from the native role cache.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedRolesRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clearCachedRoles(
Function> fn) {
return clearCachedRoles(fn.apply(new ClearCachedRolesRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_service_tokens
/**
* Clear service account token caches.
*
* Evict a subset of all entries from the service account token caches. Two
* separate caches exist for service account tokens: one cache for tokens backed
* by the service_tokens
file, and another for tokens backed by the
* .security
index. This API clears matching entries from both
* caches.
*
* The cache for service account tokens backed by the .security
* index is cleared automatically on state changes of the security index. The
* cache for tokens backed by the service_tokens
file is cleared
* automatically on file changes.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clearCachedServiceTokens(
ClearCachedServiceTokensRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedServiceTokensRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clear service account token caches.
*
* Evict a subset of all entries from the service account token caches. Two
* separate caches exist for service account tokens: one cache for tokens backed
* by the service_tokens
file, and another for tokens backed by the
* .security
index. This API clears matching entries from both
* caches.
*
* The cache for service account tokens backed by the .security
* index is cleared automatically on state changes of the security index. The
* cache for tokens backed by the service_tokens
file is cleared
* automatically on file changes.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedServiceTokensRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clearCachedServiceTokens(
Function> fn) {
return clearCachedServiceTokens(fn.apply(new ClearCachedServiceTokensRequest.Builder()).build());
}
// ----- Endpoint: security.create_api_key
/**
* Create an API key.
*
* Create an API key for access without requiring basic authentication.
*
* IMPORTANT: If the credential that is used to authenticate this request is an
* API key, the derived API key cannot have any privileges. If you specify
* privileges, the API returns an error.
*
* A successful request returns a JSON structure that contains the API key, its
* unique id, and its name. If applicable, it also returns expiration
* information for the API key in milliseconds.
*
* NOTE: By default, API keys never expire. You can specify expiration
* information when you create the API keys.
*
* The API keys are created by the Elasticsearch API key service, which is
* automatically enabled. To configure or turn off the API key service, refer to
* API key service setting documentation.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture createApiKey(CreateApiKeyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateApiKeyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create an API key.
*
* Create an API key for access without requiring basic authentication.
*
* IMPORTANT: If the credential that is used to authenticate this request is an
* API key, the derived API key cannot have any privileges. If you specify
* privileges, the API returns an error.
*
* A successful request returns a JSON structure that contains the API key, its
* unique id, and its name. If applicable, it also returns expiration
* information for the API key in milliseconds.
*
* NOTE: By default, API keys never expire. You can specify expiration
* information when you create the API keys.
*
* The API keys are created by the Elasticsearch API key service, which is
* automatically enabled. To configure or turn off the API key service, refer to
* API key service setting documentation.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture createApiKey(
Function> fn) {
return createApiKey(fn.apply(new CreateApiKeyRequest.Builder()).build());
}
/**
* Create an API key.
*
* Create an API key for access without requiring basic authentication.
*
* IMPORTANT: If the credential that is used to authenticate this request is an
* API key, the derived API key cannot have any privileges. If you specify
* privileges, the API returns an error.
*
* A successful request returns a JSON structure that contains the API key, its
* unique id, and its name. If applicable, it also returns expiration
* information for the API key in milliseconds.
*
* NOTE: By default, API keys never expire. You can specify expiration
* information when you create the API keys.
*
* The API keys are created by the Elasticsearch API key service, which is
* automatically enabled. To configure or turn off the API key service, refer to
* API key service setting documentation.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture createApiKey() {
return this.transport.performRequestAsync(new CreateApiKeyRequest.Builder().build(),
CreateApiKeyRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.create_cross_cluster_api_key
/**
* Create a cross-cluster API key.
*
* Create an API key of the cross_cluster
type for the API key
* based remote cluster access. A cross_cluster
API key cannot be
* used to authenticate through the REST interface.
*
* IMPORTANT: To authenticate this request you must use a credential that is not
* an API key. Even if you use an API key that has the required privilege, the
* API returns an error.
*
* Cross-cluster API keys are created by the Elasticsearch API key service,
* which is automatically enabled.
*
* NOTE: Unlike REST API keys, a cross-cluster API key does not capture
* permissions of the authenticated user. The API key’s effective permission is
* exactly as specified with the access
property.
*
* A successful request returns a JSON structure that contains the API key, its
* unique ID, and its name. If applicable, it also returns expiration
* information for the API key in milliseconds.
*
* By default, API keys never expire. You can specify expiration information
* when you create the API keys.
*
* Cross-cluster API keys can only be updated with the update cross-cluster API
* key API. Attempting to update them with the update REST API key API or the
* bulk update REST API keys API will result in an error.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture createCrossClusterApiKey(
CreateCrossClusterApiKeyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateCrossClusterApiKeyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create a cross-cluster API key.
*
* Create an API key of the cross_cluster
type for the API key
* based remote cluster access. A cross_cluster
API key cannot be
* used to authenticate through the REST interface.
*
* IMPORTANT: To authenticate this request you must use a credential that is not
* an API key. Even if you use an API key that has the required privilege, the
* API returns an error.
*
* Cross-cluster API keys are created by the Elasticsearch API key service,
* which is automatically enabled.
*
* NOTE: Unlike REST API keys, a cross-cluster API key does not capture
* permissions of the authenticated user. The API key’s effective permission is
* exactly as specified with the access
property.
*
* A successful request returns a JSON structure that contains the API key, its
* unique ID, and its name. If applicable, it also returns expiration
* information for the API key in milliseconds.
*
* By default, API keys never expire. You can specify expiration information
* when you create the API keys.
*
* Cross-cluster API keys can only be updated with the update cross-cluster API
* key API. Attempting to update them with the update REST API key API or the
* bulk update REST API keys API will result in an error.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateCrossClusterApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture createCrossClusterApiKey(
Function> fn) {
return createCrossClusterApiKey(fn.apply(new CreateCrossClusterApiKeyRequest.Builder()).build());
}
// ----- Endpoint: security.create_service_token
/**
* Create a service account token.
*
* Create a service accounts token for access without requiring basic
* authentication.
*
* NOTE: Service account tokens never expire. You must actively delete them if
* they are no longer needed.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture createServiceToken(CreateServiceTokenRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateServiceTokenRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create a service account token.
*
* Create a service accounts token for access without requiring basic
* authentication.
*
* NOTE: Service account tokens never expire. You must actively delete them if
* they are no longer needed.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateServiceTokenRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture createServiceToken(
Function> fn) {
return createServiceToken(fn.apply(new CreateServiceTokenRequest.Builder()).build());
}
// ----- Endpoint: security.delegate_pki
/**
* Delegate PKI authentication.
*
* This API implements the exchange of an X509Certificate chain for an
* Elasticsearch access token. The certificate chain is validated, according to
* RFC 5280, by sequentially considering the trust configuration of every
* installed PKI realm that has delegation.enabled
set to
* true
. A successfully trusted client certificate is also subject
* to the validation of the subject distinguished name according to thw
* username_pattern
of the respective realm.
*
* This API is called by smart and trusted proxies, such as Kibana, which
* terminate the user's TLS session but still want to authenticate the user by
* using a PKI realm—-as if the user connected directly to Elasticsearch.
*
* IMPORTANT: The association between the subject public key in the target
* certificate and the corresponding private key is not validated. This is part
* of the TLS authentication process and it is delegated to the proxy that calls
* this API. The proxy is trusted to have performed the TLS authentication and
* this API translates that authentication into an Elasticsearch access token.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture delegatePki(DelegatePkiRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DelegatePkiRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delegate PKI authentication.
*
* This API implements the exchange of an X509Certificate chain for an
* Elasticsearch access token. The certificate chain is validated, according to
* RFC 5280, by sequentially considering the trust configuration of every
* installed PKI realm that has delegation.enabled
set to
* true
. A successfully trusted client certificate is also subject
* to the validation of the subject distinguished name according to thw
* username_pattern
of the respective realm.
*
* This API is called by smart and trusted proxies, such as Kibana, which
* terminate the user's TLS session but still want to authenticate the user by
* using a PKI realm—-as if the user connected directly to Elasticsearch.
*
* IMPORTANT: The association between the subject public key in the target
* certificate and the corresponding private key is not validated. This is part
* of the TLS authentication process and it is delegated to the proxy that calls
* this API. The proxy is trusted to have performed the TLS authentication and
* this API translates that authentication into an Elasticsearch access token.
*
* @param fn
* a function that initializes a builder to create the
* {@link DelegatePkiRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture delegatePki(
Function> fn) {
return delegatePki(fn.apply(new DelegatePkiRequest.Builder()).build());
}
// ----- Endpoint: security.delete_privileges
/**
* Delete application privileges.
*
* To use this API, you must have one of the following privileges:
*
* - The
manage_security
cluster privilege (or a greater
* privilege such as all
).
* - The "Manage Application Privileges" global privilege for the
* application being referenced in the request.
*
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deletePrivileges(DeletePrivilegesRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeletePrivilegesRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete application privileges.
*
* To use this API, you must have one of the following privileges:
*
* - The
manage_security
cluster privilege (or a greater
* privilege such as all
).
* - The "Manage Application Privileges" global privilege for the
* application being referenced in the request.
*
*
* @param fn
* a function that initializes a builder to create the
* {@link DeletePrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deletePrivileges(
Function> fn) {
return deletePrivileges(fn.apply(new DeletePrivilegesRequest.Builder()).build());
}
// ----- Endpoint: security.delete_role
/**
* Delete roles.
*
* Delete roles in the native realm. The role management APIs are generally the
* preferred way to manage roles, rather than using file-based role management.
* The delete roles API cannot remove roles that are defined in roles files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteRole(DeleteRoleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRoleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete roles.
*
* Delete roles in the native realm. The role management APIs are generally the
* preferred way to manage roles, rather than using file-based role management.
* The delete roles API cannot remove roles that are defined in roles files.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRoleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteRole(
Function> fn) {
return deleteRole(fn.apply(new DeleteRoleRequest.Builder()).build());
}
// ----- Endpoint: security.delete_role_mapping
/**
* Delete role mappings.
*
* Role mappings define which roles are assigned to each user. The role mapping
* APIs are generally the preferred way to manage role mappings rather than
* using role mapping files. The delete role mappings API cannot remove role
* mappings that are defined in role mapping files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteRoleMapping(DeleteRoleMappingRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRoleMappingRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete role mappings.
*
* Role mappings define which roles are assigned to each user. The role mapping
* APIs are generally the preferred way to manage role mappings rather than
* using role mapping files. The delete role mappings API cannot remove role
* mappings that are defined in role mapping files.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRoleMappingRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteRoleMapping(
Function> fn) {
return deleteRoleMapping(fn.apply(new DeleteRoleMappingRequest.Builder()).build());
}
// ----- Endpoint: security.delete_service_token
/**
* Delete service account tokens.
*
* Delete service account tokens for a service in a specified namespace.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteServiceToken(DeleteServiceTokenRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteServiceTokenRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete service account tokens.
*
* Delete service account tokens for a service in a specified namespace.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteServiceTokenRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteServiceToken(
Function> fn) {
return deleteServiceToken(fn.apply(new DeleteServiceTokenRequest.Builder()).build());
}
// ----- Endpoint: security.delete_user
/**
* Delete users.
*
* Delete users from the native realm.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteUser(DeleteUserRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteUserRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete users.
*
* Delete users from the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteUserRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteUser(
Function> fn) {
return deleteUser(fn.apply(new DeleteUserRequest.Builder()).build());
}
// ----- Endpoint: security.disable_user
/**
* Disable users.
*
* Disable users in the native realm. By default, when you create users, they
* are enabled. You can use this API to revoke a user's access to Elasticsearch.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture disableUser(DisableUserRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DisableUserRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Disable users.
*
* Disable users in the native realm. By default, when you create users, they
* are enabled. You can use this API to revoke a user's access to Elasticsearch.
*
* @param fn
* a function that initializes a builder to create the
* {@link DisableUserRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture disableUser(
Function> fn) {
return disableUser(fn.apply(new DisableUserRequest.Builder()).build());
}
// ----- Endpoint: security.disable_user_profile
/**
* Disable a user profile.
*
* Disable user profiles so that they are not visible in user profile searches.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* Elastic reserves the right to change or remove this feature in future
* releases without prior notice.
*
* When you activate a user profile, its automatically enabled and visible in
* user profile searches. You can use the disable user profile API to disable a
* user profile so it’s not visible in these searches. To re-enable a disabled
* user profile, use the enable user profile API .
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture disableUserProfile(DisableUserProfileRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DisableUserProfileRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Disable a user profile.
*
* Disable user profiles so that they are not visible in user profile searches.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* Elastic reserves the right to change or remove this feature in future
* releases without prior notice.
*
* When you activate a user profile, its automatically enabled and visible in
* user profile searches. You can use the disable user profile API to disable a
* user profile so it’s not visible in these searches. To re-enable a disabled
* user profile, use the enable user profile API .
*
* @param fn
* a function that initializes a builder to create the
* {@link DisableUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture disableUserProfile(
Function> fn) {
return disableUserProfile(fn.apply(new DisableUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.enable_user
/**
* Enable users.
*
* Enable users in the native realm. By default, when you create users, they are
* enabled.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture enableUser(EnableUserRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) EnableUserRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Enable users.
*
* Enable users in the native realm. By default, when you create users, they are
* enabled.
*
* @param fn
* a function that initializes a builder to create the
* {@link EnableUserRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture enableUser(
Function> fn) {
return enableUser(fn.apply(new EnableUserRequest.Builder()).build());
}
// ----- Endpoint: security.enable_user_profile
/**
* Enable a user profile.
*
* Enable user profiles to make them visible in user profile searches.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* Elastic reserves the right to change or remove this feature in future
* releases without prior notice.
*
* When you activate a user profile, it's automatically enabled and visible in
* user profile searches. If you later disable the user profile, you can use the
* enable user profile API to make the profile visible in these searches again.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture enableUserProfile(EnableUserProfileRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) EnableUserProfileRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Enable a user profile.
*
* Enable user profiles to make them visible in user profile searches.
*
* NOTE: The user profile feature is designed only for use by Kibana and
* Elastic's Observability, Enterprise Search, and Elastic Security solutions.
* Individual users and external applications should not call this API directly.
* Elastic reserves the right to change or remove this feature in future
* releases without prior notice.
*
* When you activate a user profile, it's automatically enabled and visible in
* user profile searches. If you later disable the user profile, you can use the
* enable user profile API to make the profile visible in these searches again.
*
* @param fn
* a function that initializes a builder to create the
* {@link EnableUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture enableUserProfile(
Function> fn) {
return enableUserProfile(fn.apply(new EnableUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.enroll_kibana
/**
* Enroll Kibana.
*
* Enable a Kibana instance to configure itself for communication with a secured
* Elasticsearch cluster.
*
* NOTE: This API is currently intended for internal use only by Kibana. Kibana
* uses this API internally to configure itself for communications with an
* Elasticsearch cluster that already has security features enabled.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture enrollKibana() {
return this.transport.performRequestAsync(EnrollKibanaRequest._INSTANCE, EnrollKibanaRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.enroll_node
/**
* Enroll a node.
*
* Enroll a new node to allow it to join an existing cluster with security
* features enabled.
*
* The response contains all the necessary information for the joining node to
* bootstrap discovery and security related settings so that it can successfully
* join the cluster. The response contains key and certificate material that
* allows the caller to generate valid signed certificates for the HTTP layer of
* all nodes in the cluster.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture enrollNode() {
return this.transport.performRequestAsync(EnrollNodeRequest._INSTANCE, EnrollNodeRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_api_key
/**
* Get API key information.
*
* Retrieves information for one or more API keys. NOTE: If you have only the
* manage_own_api_key
privilege, this API returns only the API keys
* that you own. If you have read_security
,
* manage_api_key
or greater privileges (including
* manage_security
), this API returns all API keys regardless of
* ownership.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getApiKey(GetApiKeyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetApiKeyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get API key information.
*
* Retrieves information for one or more API keys. NOTE: If you have only the
* manage_own_api_key
privilege, this API returns only the API keys
* that you own. If you have read_security
,
* manage_api_key
or greater privileges (including
* manage_security
), this API returns all API keys regardless of
* ownership.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getApiKey(
Function> fn) {
return getApiKey(fn.apply(new GetApiKeyRequest.Builder()).build());
}
/**
* Get API key information.
*
* Retrieves information for one or more API keys. NOTE: If you have only the
* manage_own_api_key
privilege, this API returns only the API keys
* that you own. If you have read_security
,
* manage_api_key
or greater privileges (including
* manage_security
), this API returns all API keys regardless of
* ownership.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getApiKey() {
return this.transport.performRequestAsync(new GetApiKeyRequest.Builder().build(), GetApiKeyRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_builtin_privileges
/**
* Get builtin privileges.
*
* Get the list of cluster privileges and index privileges that are available in
* this version of Elasticsearch.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getBuiltinPrivileges() {
return this.transport.performRequestAsync(GetBuiltinPrivilegesRequest._INSTANCE,
GetBuiltinPrivilegesRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_privileges
/**
* Get application privileges.
*
* To use this API, you must have one of the following privileges:
*
* - The
read_security
cluster privilege (or a greater privilege
* such as manage_security
or all
).
* - The "Manage Application Privileges" global privilege for the
* application being referenced in the request.
*
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPrivileges(GetPrivilegesRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetPrivilegesRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get application privileges.
*
* To use this API, you must have one of the following privileges:
*
* - The
read_security
cluster privilege (or a greater privilege
* such as manage_security
or all
).
* - The "Manage Application Privileges" global privilege for the
* application being referenced in the request.
*
*
* @param fn
* a function that initializes a builder to create the
* {@link GetPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getPrivileges(
Function> fn) {
return getPrivileges(fn.apply(new GetPrivilegesRequest.Builder()).build());
}
/**
* Get application privileges.
*
* To use this API, you must have one of the following privileges:
*
* - The
read_security
cluster privilege (or a greater privilege
* such as manage_security
or all
).
* - The "Manage Application Privileges" global privilege for the
* application being referenced in the request.
*
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPrivileges() {
return this.transport.performRequestAsync(new GetPrivilegesRequest.Builder().build(),
GetPrivilegesRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_role
/**
* Get roles.
*
* Get roles in the native realm. The role management APIs are generally the
* preferred way to manage roles, rather than using file-based role management.
* The get roles API cannot retrieve roles that are defined in roles files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRole(GetRoleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetRoleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get roles.
*
* Get roles in the native realm. The role management APIs are generally the
* preferred way to manage roles, rather than using file-based role management.
* The get roles API cannot retrieve roles that are defined in roles files.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRoleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getRole(
Function> fn) {
return getRole(fn.apply(new GetRoleRequest.Builder()).build());
}
/**
* Get roles.
*
* Get roles in the native realm. The role management APIs are generally the
* preferred way to manage roles, rather than using file-based role management.
* The get roles API cannot retrieve roles that are defined in roles files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRole() {
return this.transport.performRequestAsync(new GetRoleRequest.Builder().build(), GetRoleRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_role_mapping
/**
* Get role mappings.
*
* Role mappings define which roles are assigned to each user. The role mapping
* APIs are generally the preferred way to manage role mappings rather than
* using role mapping files. The get role mappings API cannot retrieve role
* mappings that are defined in role mapping files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRoleMapping(GetRoleMappingRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetRoleMappingRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get role mappings.
*
* Role mappings define which roles are assigned to each user. The role mapping
* APIs are generally the preferred way to manage role mappings rather than
* using role mapping files. The get role mappings API cannot retrieve role
* mappings that are defined in role mapping files.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRoleMappingRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getRoleMapping(
Function> fn) {
return getRoleMapping(fn.apply(new GetRoleMappingRequest.Builder()).build());
}
/**
* Get role mappings.
*
* Role mappings define which roles are assigned to each user. The role mapping
* APIs are generally the preferred way to manage role mappings rather than
* using role mapping files. The get role mappings API cannot retrieve role
* mappings that are defined in role mapping files.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRoleMapping() {
return this.transport.performRequestAsync(new GetRoleMappingRequest.Builder().build(),
GetRoleMappingRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_service_accounts
/**
* Get service accounts.
*
* Get a list of service accounts that match the provided path parameters.
*
* NOTE: Currently, only the elastic/fleet-server
service account
* is available.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getServiceAccounts(GetServiceAccountsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetServiceAccountsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get service accounts.
*
* Get a list of service accounts that match the provided path parameters.
*
* NOTE: Currently, only the elastic/fleet-server
service account
* is available.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetServiceAccountsRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getServiceAccounts(
Function> fn) {
return getServiceAccounts(fn.apply(new GetServiceAccountsRequest.Builder()).build());
}
/**
* Get service accounts.
*
* Get a list of service accounts that match the provided path parameters.
*
* NOTE: Currently, only the elastic/fleet-server
service account
* is available.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getServiceAccounts() {
return this.transport.performRequestAsync(new GetServiceAccountsRequest.Builder().build(),
GetServiceAccountsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_service_credentials
/**
* Get service account credentials.
*
* To use this API, you must have at least the read_security
* cluster privilege (or a greater privilege such as
* manage_service_account
or manage_security
).
*
* The response includes service account tokens that were created with the
* create service account tokens API as well as file-backed tokens from all
* nodes of the cluster.
*
* NOTE: For tokens backed by the service_tokens
file, the API
* collects them from all nodes of the cluster. Tokens with the same name from
* different nodes are assumed to be the same token and are only counted once
* towards the total number of service tokens.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getServiceCredentials(
GetServiceCredentialsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetServiceCredentialsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get service account credentials.
*
* To use this API, you must have at least the read_security
* cluster privilege (or a greater privilege such as
* manage_service_account
or manage_security
).
*
* The response includes service account tokens that were created with the
* create service account tokens API as well as file-backed tokens from all
* nodes of the cluster.
*
* NOTE: For tokens backed by the service_tokens
file, the API
* collects them from all nodes of the cluster. Tokens with the same name from
* different nodes are assumed to be the same token and are only counted once
* towards the total number of service tokens.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetServiceCredentialsRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getServiceCredentials(
Function> fn) {
return getServiceCredentials(fn.apply(new GetServiceCredentialsRequest.Builder()).build());
}
// ----- Endpoint: security.get_settings
/**
* Get security index settings.
*
* Get the user-configurable settings for the security internal index
* (.security
and associated indices). Only a subset of the index
* settings — those that are user-configurable—will be shown. This includes:
*
* index.auto_expand_replicas
* index.number_of_replicas
*
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getSettings(GetSecuritySettingsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetSecuritySettingsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get security index settings.
*
* Get the user-configurable settings for the security internal index
* (.security
and associated indices). Only a subset of the index
* settings — those that are user-configurable—will be shown. This includes:
*
* index.auto_expand_replicas
* index.number_of_replicas
*
*
* @param fn
* a function that initializes a builder to create the
* {@link GetSecuritySettingsRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getSettings(
Function> fn) {
return getSettings(fn.apply(new GetSecuritySettingsRequest.Builder()).build());
}
/**
* Get security index settings.
*
* Get the user-configurable settings for the security internal index
* (.security
and associated indices). Only a subset of the index
* settings — those that are user-configurable—will be shown. This includes:
*
* index.auto_expand_replicas
* index.number_of_replicas
*
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getSettings() {
return this.transport.performRequestAsync(new GetSecuritySettingsRequest.Builder().build(),
GetSecuritySettingsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_token
/**
* Get a token.
*
* Create a bearer token for access without requiring basic authentication. The
* tokens are created by the Elasticsearch Token Service, which is automatically
* enabled when you configure TLS on the HTTP interface. Alternatively, you can
* explicitly enable the xpack.security.authc.token.enabled
* setting. When you are running in production mode, a bootstrap check prevents
* you from enabling the token service unless you also enable TLS on the HTTP
* interface.
*
* The get token API takes the same parameters as a typical OAuth 2.0 token API
* except for the use of a JSON request body.
*
* A successful get token API call returns a JSON structure that contains the
* access token, the amount of time (seconds) that the token expires in, the
* type, and the scope if available.
*
* The tokens returned by the get token API have a finite period of time for
* which they are valid and after that time period, they can no longer be used.
* That time period is defined by the
* xpack.security.authc.token.timeout
setting. If you want to
* invalidate a token immediately, you can do so by using the invalidate token
* API.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getToken(GetTokenRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetTokenRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get a token.
*
* Create a bearer token for access without requiring basic authentication. The
* tokens are created by the Elasticsearch Token Service, which is automatically
* enabled when you configure TLS on the HTTP interface. Alternatively, you can
* explicitly enable the xpack.security.authc.token.enabled
* setting. When you are running in production mode, a bootstrap check prevents
* you from enabling the token service unless you also enable TLS on the HTTP
* interface.
*
* The get token API takes the same parameters as a typical OAuth 2.0 token API
* except for the use of a JSON request body.
*
* A successful get token API call returns a JSON structure that contains the
* access token, the amount of time (seconds) that the token expires in, the
* type, and the scope if available.
*
* The tokens returned by the get token API have a finite period of time for
* which they are valid and after that time period, they can no longer be used.
* That time period is defined by the
* xpack.security.authc.token.timeout
setting. If you want to
* invalidate a token immediately, you can do so by using the invalidate token
* API.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetTokenRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getToken(
Function> fn) {
return getToken(fn.apply(new GetTokenRequest.Builder()).build());
}
/**
* Get a token.
*
* Create a bearer token for access without requiring basic authentication. The
* tokens are created by the Elasticsearch Token Service, which is automatically
* enabled when you configure TLS on the HTTP interface. Alternatively, you can
* explicitly enable the xpack.security.authc.token.enabled
* setting. When you are running in production mode, a bootstrap check prevents
* you from enabling the token service unless you also enable TLS on the HTTP
* interface.
*
* The get token API takes the same parameters as a typical OAuth 2.0 token API
* except for the use of a JSON request body.
*
* A successful get token API call returns a JSON structure that contains the
* access token, the amount of time (seconds) that the token expires in, the
* type, and the scope if available.
*
* The tokens returned by the get token API have a finite period of time for
* which they are valid and after that time period, they can no longer be used.
* That time period is defined by the
* xpack.security.authc.token.timeout
setting. If you want to
* invalidate a token immediately, you can do so by using the invalidate token
* API.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getToken() {
return this.transport.performRequestAsync(new GetTokenRequest.Builder().build(), GetTokenRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_user
/**
* Get users.
*
* Get information about users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getUser(GetUserRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetUserRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get users.
*
* Get information about users in the native realm and built-in users.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetUserRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getUser(
Function> fn) {
return getUser(fn.apply(new GetUserRequest.Builder()).build());
}
/**
* Get users.
*
* Get information about users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getUser() {
return this.transport.performRequestAsync(new GetUserRequest.Builder().build(), GetUserRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_user_privileges
/**
* Get user privileges.
*
* Get the security privileges for the logged in user. All users can use this
* API, but only to determine their own privileges. To check the privileges of
* other users, you must use the run as feature. To check whether a user has a
* specific list of privileges, use the has privileges API.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getUserPrivileges(GetUserPrivilegesRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetUserPrivilegesRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get user privileges.
*
* Get the security privileges for the logged in user. All users can use this
* API, but only to determine their own privileges. To check the privileges of
* other users, you must use the run as feature. To check whether a user has a
* specific list of privileges, use the has privileges API.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetUserPrivilegesRequest}
* @see