co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-java Show documentation
Show all versions of elasticsearch-java Show documentation
Elasticsearch Java API Client
/*
* 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.
*/
//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
package co.elastic.clients.elasticsearch.security;
import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;
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.io.IOException;
import java.util.function.Function;
import javax.annotation.Nullable;
/**
* Client for the security namespace.
*/
public class ElasticsearchSecurityClient extends ApiClient {
public ElasticsearchSecurityClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchSecurityClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchSecurityClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchSecurityClient(this.transport, transportOptions);
}
// ----- Endpoint: security.activate_user_profile
/**
* Creates or updates the user profile on behalf of another user.
*
* @see Documentation
* on elastic.co
*/
public ActivateUserProfileResponse activateUserProfile(ActivateUserProfileRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ActivateUserProfileRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates or updates the user profile on behalf of another user.
*
* @param fn
* a function that initializes a builder to create the
* {@link ActivateUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final ActivateUserProfileResponse activateUserProfile(
Function> fn)
throws IOException, ElasticsearchException {
return activateUserProfile(fn.apply(new ActivateUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.authenticate
/**
* Enables authentication as a user and retrieve information about the
* authenticated user.
*
* @see Documentation
* on elastic.co
*/
public AuthenticateResponse authenticate() throws IOException, ElasticsearchException {
return this.transport.performRequest(AuthenticateRequest._INSTANCE, AuthenticateRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.change_password
/**
* Changes the passwords of users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public ChangePasswordResponse changePassword(ChangePasswordRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ChangePasswordRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Changes 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 ChangePasswordResponse changePassword(
Function> fn)
throws IOException, ElasticsearchException {
return changePassword(fn.apply(new ChangePasswordRequest.Builder()).build());
}
/**
* Changes the passwords of users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public ChangePasswordResponse changePassword() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ChangePasswordRequest.Builder().build(),
ChangePasswordRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.clear_api_key_cache
/**
* Clear a subset or all entries from the API key cache.
*
* @see Documentation
* on elastic.co
*/
public ClearApiKeyCacheResponse clearApiKeyCache(ClearApiKeyCacheRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearApiKeyCacheRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Clear a subset or all entries from the API key cache.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearApiKeyCacheRequest}
* @see Documentation
* on elastic.co
*/
public final ClearApiKeyCacheResponse clearApiKeyCache(
Function> fn)
throws IOException, ElasticsearchException {
return clearApiKeyCache(fn.apply(new ClearApiKeyCacheRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_privileges
/**
* Evicts application privileges from the native application privileges cache.
*
* @see Documentation
* on elastic.co
*/
public ClearCachedPrivilegesResponse clearCachedPrivileges(ClearCachedPrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedPrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Evicts application privileges from the native application privileges cache.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final ClearCachedPrivilegesResponse clearCachedPrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return clearCachedPrivileges(fn.apply(new ClearCachedPrivilegesRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_realms
/**
* Evicts users from the user cache. Can completely clear the cache or evict
* specific users.
*
* @see Documentation
* on elastic.co
*/
public ClearCachedRealmsResponse clearCachedRealms(ClearCachedRealmsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedRealmsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Evicts users from the user cache. Can completely clear the cache or evict
* specific users.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedRealmsRequest}
* @see Documentation
* on elastic.co
*/
public final ClearCachedRealmsResponse clearCachedRealms(
Function> fn)
throws IOException, ElasticsearchException {
return clearCachedRealms(fn.apply(new ClearCachedRealmsRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_roles
/**
* Evicts roles from the native role cache.
*
* @see Documentation
* on elastic.co
*/
public ClearCachedRolesResponse clearCachedRoles(ClearCachedRolesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedRolesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Evicts 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 ClearCachedRolesResponse clearCachedRoles(
Function> fn)
throws IOException, ElasticsearchException {
return clearCachedRoles(fn.apply(new ClearCachedRolesRequest.Builder()).build());
}
// ----- Endpoint: security.clear_cached_service_tokens
/**
* Evicts tokens from the service account token caches.
*
* @see Documentation
* on elastic.co
*/
public ClearCachedServiceTokensResponse clearCachedServiceTokens(ClearCachedServiceTokensRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCachedServiceTokensRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Evicts tokens from the service account token caches.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCachedServiceTokensRequest}
* @see Documentation
* on elastic.co
*/
public final ClearCachedServiceTokensResponse clearCachedServiceTokens(
Function> fn)
throws IOException, ElasticsearchException {
return clearCachedServiceTokens(fn.apply(new ClearCachedServiceTokensRequest.Builder()).build());
}
// ----- Endpoint: security.create_api_key
/**
* Creates an API key for access without requiring basic authentication.
*
* @see Documentation
* on elastic.co
*/
public CreateApiKeyResponse createApiKey(CreateApiKeyRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateApiKeyRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates an API key for access without requiring basic authentication.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final CreateApiKeyResponse createApiKey(
Function> fn)
throws IOException, ElasticsearchException {
return createApiKey(fn.apply(new CreateApiKeyRequest.Builder()).build());
}
/**
* Creates an API key for access without requiring basic authentication.
*
* @see Documentation
* on elastic.co
*/
public CreateApiKeyResponse createApiKey() throws IOException, ElasticsearchException {
return this.transport.performRequest(new CreateApiKeyRequest.Builder().build(), CreateApiKeyRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.create_service_token
/**
* Creates a service account token for access without requiring basic
* authentication.
*
* @see Documentation
* on elastic.co
*/
public CreateServiceTokenResponse createServiceToken(CreateServiceTokenRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateServiceTokenRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a service account token for access without requiring basic
* authentication.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateServiceTokenRequest}
* @see Documentation
* on elastic.co
*/
public final CreateServiceTokenResponse createServiceToken(
Function> fn)
throws IOException, ElasticsearchException {
return createServiceToken(fn.apply(new CreateServiceTokenRequest.Builder()).build());
}
// ----- Endpoint: security.delete_privileges
/**
* Removes application privileges.
*
* @see Documentation
* on elastic.co
*/
public DeletePrivilegesResponse deletePrivileges(DeletePrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeletePrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes application privileges.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeletePrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final DeletePrivilegesResponse deletePrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return deletePrivileges(fn.apply(new DeletePrivilegesRequest.Builder()).build());
}
// ----- Endpoint: security.delete_role
/**
* Removes roles in the native realm.
*
* @see Documentation
* on elastic.co
*/
public DeleteRoleResponse deleteRole(DeleteRoleRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRoleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes roles in the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRoleRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteRoleResponse deleteRole(Function> fn)
throws IOException, ElasticsearchException {
return deleteRole(fn.apply(new DeleteRoleRequest.Builder()).build());
}
// ----- Endpoint: security.delete_role_mapping
/**
* Removes role mappings.
*
* @see Documentation
* on elastic.co
*/
public DeleteRoleMappingResponse deleteRoleMapping(DeleteRoleMappingRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRoleMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes role mappings.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRoleMappingRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteRoleMappingResponse deleteRoleMapping(
Function> fn)
throws IOException, ElasticsearchException {
return deleteRoleMapping(fn.apply(new DeleteRoleMappingRequest.Builder()).build());
}
// ----- Endpoint: security.delete_service_token
/**
* Deletes a service account token.
*
* @see Documentation
* on elastic.co
*/
public DeleteServiceTokenResponse deleteServiceToken(DeleteServiceTokenRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteServiceTokenRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes a service account token.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteServiceTokenRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteServiceTokenResponse deleteServiceToken(
Function> fn)
throws IOException, ElasticsearchException {
return deleteServiceToken(fn.apply(new DeleteServiceTokenRequest.Builder()).build());
}
// ----- Endpoint: security.delete_user
/**
* Deletes users from the native realm.
*
* @see Documentation
* on elastic.co
*/
public DeleteUserResponse deleteUser(DeleteUserRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteUserRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes 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 DeleteUserResponse deleteUser(Function> fn)
throws IOException, ElasticsearchException {
return deleteUser(fn.apply(new DeleteUserRequest.Builder()).build());
}
// ----- Endpoint: security.disable_user
/**
* Disables users in the native realm.
*
* @see Documentation
* on elastic.co
*/
public DisableUserResponse disableUser(DisableUserRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DisableUserRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Disables users in the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link DisableUserRequest}
* @see Documentation
* on elastic.co
*/
public final DisableUserResponse disableUser(
Function> fn)
throws IOException, ElasticsearchException {
return disableUser(fn.apply(new DisableUserRequest.Builder()).build());
}
// ----- Endpoint: security.disable_user_profile
/**
* Disables a user profile so it's not visible in user profile searches.
*
* @see Documentation
* on elastic.co
*/
public DisableUserProfileResponse disableUserProfile(DisableUserProfileRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DisableUserProfileRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Disables a user profile so it's not visible in user profile searches.
*
* @param fn
* a function that initializes a builder to create the
* {@link DisableUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final DisableUserProfileResponse disableUserProfile(
Function> fn)
throws IOException, ElasticsearchException {
return disableUserProfile(fn.apply(new DisableUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.enable_user
/**
* Enables users in the native realm.
*
* @see Documentation
* on elastic.co
*/
public EnableUserResponse enableUser(EnableUserRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) EnableUserRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Enables users in the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link EnableUserRequest}
* @see Documentation
* on elastic.co
*/
public final EnableUserResponse enableUser(Function> fn)
throws IOException, ElasticsearchException {
return enableUser(fn.apply(new EnableUserRequest.Builder()).build());
}
// ----- Endpoint: security.enable_user_profile
/**
* Enables a user profile so it's visible in user profile searches.
*
* @see Documentation
* on elastic.co
*/
public EnableUserProfileResponse enableUserProfile(EnableUserProfileRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) EnableUserProfileRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Enables a user profile so it's visible in user profile searches.
*
* @param fn
* a function that initializes a builder to create the
* {@link EnableUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final EnableUserProfileResponse enableUserProfile(
Function> fn)
throws IOException, ElasticsearchException {
return enableUserProfile(fn.apply(new EnableUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.enroll_kibana
/**
* Allows a kibana instance to configure itself to communicate with a secured
* elasticsearch cluster.
*
* @see Documentation
* on elastic.co
*/
public EnrollKibanaResponse enrollKibana() throws IOException, ElasticsearchException {
return this.transport.performRequest(EnrollKibanaRequest._INSTANCE, EnrollKibanaRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.enroll_node
/**
* Allows a new node to enroll to an existing cluster with security enabled.
*
* @see Documentation
* on elastic.co
*/
public EnrollNodeResponse enrollNode() throws IOException, ElasticsearchException {
return this.transport.performRequest(EnrollNodeRequest._INSTANCE, EnrollNodeRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_api_key
/**
* Retrieves information for one or more API keys.
*
* @see Documentation
* on elastic.co
*/
public GetApiKeyResponse getApiKey(GetApiKeyRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetApiKeyRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information for one or more API keys.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final GetApiKeyResponse getApiKey(Function> fn)
throws IOException, ElasticsearchException {
return getApiKey(fn.apply(new GetApiKeyRequest.Builder()).build());
}
/**
* Retrieves information for one or more API keys.
*
* @see Documentation
* on elastic.co
*/
public GetApiKeyResponse getApiKey() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetApiKeyRequest.Builder().build(), GetApiKeyRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_builtin_privileges
/**
* Retrieves the list of cluster privileges and index privileges that are
* available in this version of Elasticsearch.
*
* @see Documentation
* on elastic.co
*/
public GetBuiltinPrivilegesResponse getBuiltinPrivileges() throws IOException, ElasticsearchException {
return this.transport.performRequest(GetBuiltinPrivilegesRequest._INSTANCE,
GetBuiltinPrivilegesRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_privileges
/**
* Retrieves application privileges.
*
* @see Documentation
* on elastic.co
*/
public GetPrivilegesResponse getPrivileges(GetPrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetPrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves application privileges.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final GetPrivilegesResponse getPrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return getPrivileges(fn.apply(new GetPrivilegesRequest.Builder()).build());
}
/**
* Retrieves application privileges.
*
* @see Documentation
* on elastic.co
*/
public GetPrivilegesResponse getPrivileges() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetPrivilegesRequest.Builder().build(), GetPrivilegesRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_role
/**
* Retrieves roles in the native realm.
*
* @see Documentation
* on elastic.co
*/
public GetRoleResponse getRole(GetRoleRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetRoleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves roles in the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRoleRequest}
* @see Documentation
* on elastic.co
*/
public final GetRoleResponse getRole(Function> fn)
throws IOException, ElasticsearchException {
return getRole(fn.apply(new GetRoleRequest.Builder()).build());
}
/**
* Retrieves roles in the native realm.
*
* @see Documentation
* on elastic.co
*/
public GetRoleResponse getRole() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetRoleRequest.Builder().build(), GetRoleRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_role_mapping
/**
* Retrieves role mappings.
*
* @see Documentation
* on elastic.co
*/
public GetRoleMappingResponse getRoleMapping(GetRoleMappingRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetRoleMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves role mappings.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRoleMappingRequest}
* @see Documentation
* on elastic.co
*/
public final GetRoleMappingResponse getRoleMapping(
Function> fn)
throws IOException, ElasticsearchException {
return getRoleMapping(fn.apply(new GetRoleMappingRequest.Builder()).build());
}
/**
* Retrieves role mappings.
*
* @see Documentation
* on elastic.co
*/
public GetRoleMappingResponse getRoleMapping() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetRoleMappingRequest.Builder().build(),
GetRoleMappingRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_service_accounts
/**
* Retrieves information about service accounts.
*
* @see Documentation
* on elastic.co
*/
public GetServiceAccountsResponse getServiceAccounts(GetServiceAccountsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetServiceAccountsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information about service accounts.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetServiceAccountsRequest}
* @see Documentation
* on elastic.co
*/
public final GetServiceAccountsResponse getServiceAccounts(
Function> fn)
throws IOException, ElasticsearchException {
return getServiceAccounts(fn.apply(new GetServiceAccountsRequest.Builder()).build());
}
/**
* Retrieves information about service accounts.
*
* @see Documentation
* on elastic.co
*/
public GetServiceAccountsResponse getServiceAccounts() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetServiceAccountsRequest.Builder().build(),
GetServiceAccountsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_service_credentials
/**
* Retrieves information of all service credentials for a service account.
*
* @see Documentation
* on elastic.co
*/
public GetServiceCredentialsResponse getServiceCredentials(GetServiceCredentialsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetServiceCredentialsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information of all service credentials for a service account.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetServiceCredentialsRequest}
* @see Documentation
* on elastic.co
*/
public final GetServiceCredentialsResponse getServiceCredentials(
Function> fn)
throws IOException, ElasticsearchException {
return getServiceCredentials(fn.apply(new GetServiceCredentialsRequest.Builder()).build());
}
// ----- Endpoint: security.get_token
/**
* Creates a bearer token for access without requiring basic authentication.
*
* @see Documentation
* on elastic.co
*/
public GetTokenResponse getToken(GetTokenRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetTokenRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a bearer token for access without requiring basic authentication.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetTokenRequest}
* @see Documentation
* on elastic.co
*/
public final GetTokenResponse getToken(Function> fn)
throws IOException, ElasticsearchException {
return getToken(fn.apply(new GetTokenRequest.Builder()).build());
}
/**
* Creates a bearer token for access without requiring basic authentication.
*
* @see Documentation
* on elastic.co
*/
public GetTokenResponse getToken() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetTokenRequest.Builder().build(), GetTokenRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_user
/**
* Retrieves information about users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public GetUserResponse getUser(GetUserRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetUserRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves 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 GetUserResponse getUser(Function> fn)
throws IOException, ElasticsearchException {
return getUser(fn.apply(new GetUserRequest.Builder()).build());
}
/**
* Retrieves information about users in the native realm and built-in users.
*
* @see Documentation
* on elastic.co
*/
public GetUserResponse getUser() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetUserRequest.Builder().build(), GetUserRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.get_user_privileges
/**
* Retrieves security privileges for the logged in user.
*
* @see Documentation
* on elastic.co
*/
public GetUserPrivilegesResponse getUserPrivileges(GetUserPrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetUserPrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves security privileges for the logged in user.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetUserPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final GetUserPrivilegesResponse getUserPrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return getUserPrivileges(fn.apply(new GetUserPrivilegesRequest.Builder()).build());
}
/**
* Retrieves security privileges for the logged in user.
*
* @see Documentation
* on elastic.co
*/
public GetUserPrivilegesResponse getUserPrivileges() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetUserPrivilegesRequest.Builder().build(),
GetUserPrivilegesRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.get_user_profile
/**
* Retrieves user profile for the given unique ID.
*
* @see Documentation
* on elastic.co
*/
public GetUserProfileResponse getUserProfile(GetUserProfileRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetUserProfileRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves user profile for the given unique ID.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetUserProfileRequest}
* @see Documentation
* on elastic.co
*/
public final GetUserProfileResponse getUserProfile(
Function> fn)
throws IOException, ElasticsearchException {
return getUserProfile(fn.apply(new GetUserProfileRequest.Builder()).build());
}
// ----- Endpoint: security.grant_api_key
/**
* Creates an API key on behalf of another user.
*
* @see Documentation
* on elastic.co
*/
public GrantApiKeyResponse grantApiKey(GrantApiKeyRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GrantApiKeyRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates an API key on behalf of another user.
*
* @param fn
* a function that initializes a builder to create the
* {@link GrantApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final GrantApiKeyResponse grantApiKey(
Function> fn)
throws IOException, ElasticsearchException {
return grantApiKey(fn.apply(new GrantApiKeyRequest.Builder()).build());
}
// ----- Endpoint: security.has_privileges
/**
* Determines whether the specified user has a specified list of privileges.
*
* @see Documentation
* on elastic.co
*/
public HasPrivilegesResponse hasPrivileges(HasPrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) HasPrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Determines whether the specified user has a specified list of privileges.
*
* @param fn
* a function that initializes a builder to create the
* {@link HasPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final HasPrivilegesResponse hasPrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return hasPrivileges(fn.apply(new HasPrivilegesRequest.Builder()).build());
}
/**
* Determines whether the specified user has a specified list of privileges.
*
* @see Documentation
* on elastic.co
*/
public HasPrivilegesResponse hasPrivileges() throws IOException, ElasticsearchException {
return this.transport.performRequest(new HasPrivilegesRequest.Builder().build(), HasPrivilegesRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.invalidate_api_key
/**
* Invalidates one or more API keys.
*
* @see Documentation
* on elastic.co
*/
public InvalidateApiKeyResponse invalidateApiKey(InvalidateApiKeyRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) InvalidateApiKeyRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Invalidates one or more API keys.
*
* @param fn
* a function that initializes a builder to create the
* {@link InvalidateApiKeyRequest}
* @see Documentation
* on elastic.co
*/
public final InvalidateApiKeyResponse invalidateApiKey(
Function> fn)
throws IOException, ElasticsearchException {
return invalidateApiKey(fn.apply(new InvalidateApiKeyRequest.Builder()).build());
}
/**
* Invalidates one or more API keys.
*
* @see Documentation
* on elastic.co
*/
public InvalidateApiKeyResponse invalidateApiKey() throws IOException, ElasticsearchException {
return this.transport.performRequest(new InvalidateApiKeyRequest.Builder().build(),
InvalidateApiKeyRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.invalidate_token
/**
* Invalidates one or more access tokens or refresh tokens.
*
* @see Documentation
* on elastic.co
*/
public InvalidateTokenResponse invalidateToken(InvalidateTokenRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) InvalidateTokenRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Invalidates one or more access tokens or refresh tokens.
*
* @param fn
* a function that initializes a builder to create the
* {@link InvalidateTokenRequest}
* @see Documentation
* on elastic.co
*/
public final InvalidateTokenResponse invalidateToken(
Function> fn)
throws IOException, ElasticsearchException {
return invalidateToken(fn.apply(new InvalidateTokenRequest.Builder()).build());
}
/**
* Invalidates one or more access tokens or refresh tokens.
*
* @see Documentation
* on elastic.co
*/
public InvalidateTokenResponse invalidateToken() throws IOException, ElasticsearchException {
return this.transport.performRequest(new InvalidateTokenRequest.Builder().build(),
InvalidateTokenRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.put_privileges
/**
* Adds or updates application privileges.
*
* @see Documentation
* on elastic.co
*/
public PutPrivilegesResponse putPrivileges(PutPrivilegesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutPrivilegesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds or updates application privileges.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutPrivilegesRequest}
* @see Documentation
* on elastic.co
*/
public final PutPrivilegesResponse putPrivileges(
Function> fn)
throws IOException, ElasticsearchException {
return putPrivileges(fn.apply(new PutPrivilegesRequest.Builder()).build());
}
/**
* Adds or updates application privileges.
*
* @see Documentation
* on elastic.co
*/
public PutPrivilegesResponse putPrivileges() throws IOException, ElasticsearchException {
return this.transport.performRequest(new PutPrivilegesRequest.Builder().build(), PutPrivilegesRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.put_role
/**
* Adds and updates roles in the native realm.
*
* @see Documentation
* on elastic.co
*/
public PutRoleResponse putRole(PutRoleRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutRoleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds and updates roles in the native realm.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutRoleRequest}
* @see Documentation
* on elastic.co
*/
public final PutRoleResponse putRole(Function> fn)
throws IOException, ElasticsearchException {
return putRole(fn.apply(new PutRoleRequest.Builder()).build());
}
// ----- Endpoint: security.put_role_mapping
/**
* Creates and updates role mappings.
*
* @see Documentation
* on elastic.co
*/
public PutRoleMappingResponse putRoleMapping(PutRoleMappingRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutRoleMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates and updates role mappings.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutRoleMappingRequest}
* @see Documentation
* on elastic.co
*/
public final PutRoleMappingResponse putRoleMapping(
Function> fn)
throws IOException, ElasticsearchException {
return putRoleMapping(fn.apply(new PutRoleMappingRequest.Builder()).build());
}
// ----- Endpoint: security.put_user
/**
* Adds and updates users in the native realm. These users are commonly referred
* to as native users.
*
* @see Documentation
* on elastic.co
*/
public PutUserResponse putUser(PutUserRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutUserRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds and updates users in the native realm. These users are commonly referred
* to as native users.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutUserRequest}
* @see Documentation
* on elastic.co
*/
public final PutUserResponse putUser(Function> fn)
throws IOException, ElasticsearchException {
return putUser(fn.apply(new PutUserRequest.Builder()).build());
}
// ----- Endpoint: security.query_api_keys
/**
* Retrieves information for API keys using a subset of query DSL
*
* @see Documentation
* on elastic.co
*/
public QueryApiKeysResponse queryApiKeys(QueryApiKeysRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) QueryApiKeysRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information for API keys using a subset of query DSL
*
* @param fn
* a function that initializes a builder to create the
* {@link QueryApiKeysRequest}
* @see Documentation
* on elastic.co
*/
public final QueryApiKeysResponse queryApiKeys(
Function> fn)
throws IOException, ElasticsearchException {
return queryApiKeys(fn.apply(new QueryApiKeysRequest.Builder()).build());
}
/**
* Retrieves information for API keys using a subset of query DSL
*
* @see Documentation
* on elastic.co
*/
public QueryApiKeysResponse queryApiKeys() throws IOException, ElasticsearchException {
return this.transport.performRequest(new QueryApiKeysRequest.Builder().build(), QueryApiKeysRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: security.saml_authenticate
/**
* Exchanges a SAML Response message for an Elasticsearch access token and
* refresh token pair
*
* @see Documentation
* on elastic.co
*/
public SamlAuthenticateResponse samlAuthenticate(SamlAuthenticateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlAuthenticateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Exchanges a SAML Response message for an Elasticsearch access token and
* refresh token pair
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlAuthenticateRequest}
* @see Documentation
* on elastic.co
*/
public final SamlAuthenticateResponse samlAuthenticate(
Function> fn)
throws IOException, ElasticsearchException {
return samlAuthenticate(fn.apply(new SamlAuthenticateRequest.Builder()).build());
}
// ----- Endpoint: security.saml_complete_logout
/**
* Verifies the logout response sent from the SAML IdP
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse samlCompleteLogout(SamlCompleteLogoutRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlCompleteLogoutRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Verifies the logout response sent from the SAML IdP
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlCompleteLogoutRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse samlCompleteLogout(
Function> fn)
throws IOException, ElasticsearchException {
return samlCompleteLogout(fn.apply(new SamlCompleteLogoutRequest.Builder()).build());
}
// ----- Endpoint: security.saml_invalidate
/**
* Consumes a SAML LogoutRequest
*
* @see Documentation
* on elastic.co
*/
public SamlInvalidateResponse samlInvalidate(SamlInvalidateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlInvalidateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Consumes a SAML LogoutRequest
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlInvalidateRequest}
* @see Documentation
* on elastic.co
*/
public final SamlInvalidateResponse samlInvalidate(
Function> fn)
throws IOException, ElasticsearchException {
return samlInvalidate(fn.apply(new SamlInvalidateRequest.Builder()).build());
}
// ----- Endpoint: security.saml_logout
/**
* Invalidates an access token and a refresh token that were generated via the
* SAML Authenticate API
*
* @see Documentation
* on elastic.co
*/
public SamlLogoutResponse samlLogout(SamlLogoutRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlLogoutRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Invalidates an access token and a refresh token that were generated via the
* SAML Authenticate API
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlLogoutRequest}
* @see Documentation
* on elastic.co
*/
public final SamlLogoutResponse samlLogout(Function> fn)
throws IOException, ElasticsearchException {
return samlLogout(fn.apply(new SamlLogoutRequest.Builder()).build());
}
// ----- Endpoint: security.saml_prepare_authentication
/**
* Creates a SAML authentication request
*
* @see Documentation
* on elastic.co
*/
public SamlPrepareAuthenticationResponse samlPrepareAuthentication(SamlPrepareAuthenticationRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlPrepareAuthenticationRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a SAML authentication request
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlPrepareAuthenticationRequest}
* @see Documentation
* on elastic.co
*/
public final SamlPrepareAuthenticationResponse samlPrepareAuthentication(
Function> fn)
throws IOException, ElasticsearchException {
return samlPrepareAuthentication(fn.apply(new SamlPrepareAuthenticationRequest.Builder()).build());
}
/**
* Creates a SAML authentication request
*
* @see Documentation
* on elastic.co
*/
public SamlPrepareAuthenticationResponse samlPrepareAuthentication() throws IOException, ElasticsearchException {
return this.transport.performRequest(new SamlPrepareAuthenticationRequest.Builder().build(),
SamlPrepareAuthenticationRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.saml_service_provider_metadata
/**
* Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
*
* @see Documentation
* on elastic.co
*/
public SamlServiceProviderMetadataResponse samlServiceProviderMetadata(SamlServiceProviderMetadataRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SamlServiceProviderMetadataRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
*
* @param fn
* a function that initializes a builder to create the
* {@link SamlServiceProviderMetadataRequest}
* @see Documentation
* on elastic.co
*/
public final SamlServiceProviderMetadataResponse samlServiceProviderMetadata(
Function> fn)
throws IOException, ElasticsearchException {
return samlServiceProviderMetadata(fn.apply(new SamlServiceProviderMetadataRequest.Builder()).build());
}
// ----- Endpoint: security.suggest_user_profiles
/**
* Get suggestions for user profiles that match specified search criteria.
*
* @see Documentation
* on elastic.co
*/
public SuggestUserProfilesResponse suggestUserProfiles(SuggestUserProfilesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SuggestUserProfilesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Get suggestions for user profiles that match specified search criteria.
*
* @param fn
* a function that initializes a builder to create the
* {@link SuggestUserProfilesRequest}
* @see Documentation
* on elastic.co
*/
public final SuggestUserProfilesResponse suggestUserProfiles(
Function> fn)
throws IOException, ElasticsearchException {
return suggestUserProfiles(fn.apply(new SuggestUserProfilesRequest.Builder()).build());
}
/**
* Get suggestions for user profiles that match specified search criteria.
*
* @see Documentation
* on elastic.co
*/
public SuggestUserProfilesResponse suggestUserProfiles() throws IOException, ElasticsearchException {
return this.transport.performRequest(new SuggestUserProfilesRequest.Builder().build(),
SuggestUserProfilesRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: security.update_user_profile_data
/**
* Update application specific data for the user profile of the given unique ID.
*
* @see Documentation
* on elastic.co
*/
public UpdateUserProfileDataResponse updateUserProfileData(UpdateUserProfileDataRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) UpdateUserProfileDataRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Update application specific data for the user profile of the given unique ID.
*
* @param fn
* a function that initializes a builder to create the
* {@link UpdateUserProfileDataRequest}
* @see Documentation
* on elastic.co
*/
public final UpdateUserProfileDataResponse updateUserProfileData(
Function> fn)
throws IOException, ElasticsearchException {
return updateUserProfileData(fn.apply(new UpdateUserProfileDataRequest.Builder()).build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy