diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyclusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-core-server.legacyclusterclient.callasinternaluser.md
index 2e235485711c6..7c8cc18d24e29 100644
--- a/docs/development/core/server/kibana-plugin-core-server.legacyclusterclient.callasinternaluser.md
+++ b/docs/development/core/server/kibana-plugin-core-server.legacyclusterclient.callasinternaluser.md
@@ -4,6 +4,11 @@
## LegacyClusterClient.callAsInternalUser property
+> Warning: This API is now obsolete.
+>
+> Use [IClusterClient.asInternalUser](./kibana-plugin-core-server.iclusterclient.asinternaluser.md).
+>
+
Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. See [LegacyAPICaller](./kibana-plugin-core-server.legacyapicaller.md).
Signature:
diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callascurrentuser.md b/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callascurrentuser.md
index 9130f9adde76e..7517acc59ac80 100644
--- a/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callascurrentuser.md
+++ b/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callascurrentuser.md
@@ -4,6 +4,11 @@
## LegacyScopedClusterClient.callAsCurrentUser() method
+> Warning: This API is now obsolete.
+>
+> Use [IScopedClusterClient.asCurrentUser](./kibana-plugin-core-server.iscopedclusterclient.ascurrentuser.md).
+>
+
Calls specified `endpoint` with provided `clientParams` on behalf of the user initiated request to the Kibana server (via HTTP request headers). See [LegacyAPICaller](./kibana-plugin-core-server.legacyapicaller.md).
Signature:
diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callasinternaluser.md
index bf95782299e72..b683d3945f9ff 100644
--- a/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callasinternaluser.md
+++ b/docs/development/core/server/kibana-plugin-core-server.legacyscopedclusterclient.callasinternaluser.md
@@ -4,6 +4,11 @@
## LegacyScopedClusterClient.callAsInternalUser() method
+> Warning: This API is now obsolete.
+>
+> Use [IScopedClusterClient.asInternalUser](./kibana-plugin-core-server.iscopedclusterclient.asinternaluser.md).
+>
+
Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana internal user. See [LegacyAPICaller](./kibana-plugin-core-server.legacyapicaller.md).
Signature:
diff --git a/src/core/server/elasticsearch/legacy/cluster_client.ts b/src/core/server/elasticsearch/legacy/cluster_client.ts
index 00417e3bef4f4..e851b3a4db711 100644
--- a/src/core/server/elasticsearch/legacy/cluster_client.ts
+++ b/src/core/server/elasticsearch/legacy/cluster_client.ts
@@ -140,6 +140,7 @@ export class LegacyClusterClient implements ILegacyClusterClient {
* Calls specified endpoint with provided clientParams on behalf of the
* Kibana internal user.
* See {@link LegacyAPICaller}.
+ * @deprecated Use {@link IClusterClient.asInternalUser}.
*
* @param endpoint - String descriptor of the endpoint e.g. `cluster.getSettings` or `ping`.
* @param clientParams - A dictionary of parameters that will be passed directly to the Elasticsearch JS client.
diff --git a/src/core/server/elasticsearch/legacy/scoped_cluster_client.ts b/src/core/server/elasticsearch/legacy/scoped_cluster_client.ts
index 65484f0927c9e..e3f3d33d03766 100644
--- a/src/core/server/elasticsearch/legacy/scoped_cluster_client.ts
+++ b/src/core/server/elasticsearch/legacy/scoped_cluster_client.ts
@@ -56,6 +56,7 @@ export class LegacyScopedClusterClient implements ILegacyScopedClusterClient {
* Calls specified `endpoint` with provided `clientParams` on behalf of the
* Kibana internal user.
* See {@link LegacyAPICaller}.
+ * @deprecated Use {@link IScopedClusterClient.asInternalUser}.
*
* @param endpoint - String descriptor of the endpoint e.g. `cluster.getSettings` or `ping`.
* @param clientParams - A dictionary of parameters that will be passed directly to the Elasticsearch JS client.
@@ -73,6 +74,7 @@ export class LegacyScopedClusterClient implements ILegacyScopedClusterClient {
* Calls specified `endpoint` with provided `clientParams` on behalf of the
* user initiated request to the Kibana server (via HTTP request headers).
* See {@link LegacyAPICaller}.
+ * @deprecated Use {@link IScopedClusterClient.asCurrentUser}.
*
* @param endpoint - String descriptor of the endpoint e.g. `cluster.getSettings` or `ping`.
* @param clientParams - A dictionary of parameters that will be passed directly to the Elasticsearch JS client.
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index 7b19c3a686757..9e654ea1e2303 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -394,6 +394,9 @@ export interface RequestHandlerContext {
elasticsearch: {
client: IScopedClusterClient;
legacy: {
+ /*
+ * @deprecated Use {@link IScopedClusterClient}.
+ */
client: ILegacyScopedClusterClient;
};
};
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index a03e5ec9acd27..8dddff07a0e4c 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -1324,6 +1324,7 @@ export interface LegacyCallAPIOptions {
export class LegacyClusterClient implements ILegacyClusterClient {
constructor(config: LegacyElasticsearchClientConfig, log: Logger, getAuthHeaders?: GetAuthHeaders);
asScoped(request?: ScopeableRequest): ILegacyScopedClusterClient;
+ // @deprecated
callAsInternalUser: LegacyAPICaller;
close(): void;
}
@@ -1371,7 +1372,9 @@ export interface LegacyRequest extends Request {
// @public @deprecated
export class LegacyScopedClusterClient implements ILegacyScopedClusterClient {
constructor(internalAPICaller: LegacyAPICaller, scopedAPICaller: LegacyAPICaller, headers?: Headers | undefined);
+ // @deprecated
callAsCurrentUser(endpoint: string, clientParams?: Record, options?: LegacyCallAPIOptions): Promise;
+ // @deprecated
callAsInternalUser(endpoint: string, clientParams?: Record, options?: LegacyCallAPIOptions): Promise;
}