Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] mark legacy ES client methods deprecated #84358

Merged
merged 4 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)<!-- -->.

<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)<!-- -->.

<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)<!-- -->.

<b>Signature:</b>
Expand Down
1 change: 1 addition & 0 deletions src/core/server/elasticsearch/legacy/cluster_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/core/server/elasticsearch/legacy/scoped_cluster_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ export interface RequestHandlerContext {
elasticsearch: {
client: IScopedClusterClient;
legacy: {
/* @deprecated Use {@link IScopedClusterClient}. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo (tsdoc is probably not generated from this): /* -> /**

client: ILegacyScopedClusterClient;
};
};
Expand Down
3 changes: 3 additions & 0 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<string, any>, options?: LegacyCallAPIOptions): Promise<any>;
// @deprecated
callAsInternalUser(endpoint: string, clientParams?: Record<string, any>, options?: LegacyCallAPIOptions): Promise<any>;
}

Expand Down