[Core] mark legacy ES client methods deprecated (#84358)

* mark context ES client & ES client methods deprecated

* update docs

* improve comment
This commit is contained in:
Mikhail Shustov 2020-11-30 21:15:17 +03:00 committed by GitHub
parent 1ec2f1d078
commit cb0a3595a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 0 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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.

View file

@ -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.

View file

@ -394,6 +394,9 @@ export interface RequestHandlerContext {
elasticsearch: {
client: IScopedClusterClient;
legacy: {
/*
* @deprecated Use {@link IScopedClusterClient}.
*/
client: ILegacyScopedClusterClient;
};
};

View file

@ -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<string, any>, options?: LegacyCallAPIOptions): Promise<any>;
// @deprecated
callAsInternalUser(endpoint: string, clientParams?: Record<string, any>, options?: LegacyCallAPIOptions): Promise<any>;
}