Opensearch dashboards.legacyclusterclient
Home > opensearch-dashboards > LegacyClusterClient
LegacyClusterClient class
Warning: This API is now obsolete.
Use IClusterClient.
Represents an OpenSearch cluster API client created by the platform. It allows to call API on behalf of the internal OpenSearch Dashboards user and the actual user that is derived from the request headers (via asScoped(...)).
Signature:
export declare class LegacyClusterClient implements ILegacyClusterClient 
Implements: ILegacyClusterClient
Constructors
| Constructor | Modifiers | Description | 
|---|---|---|
| (constructor)(config, log, getAuditorFactory, getAuthHeaders) | Constructs a new instance of the LegacyClusterClientclass | 
Properties
| Property | Modifiers | Type | Description | 
|---|---|---|---|
| callAsInternalUser | LegacyAPICaller | Calls specified endpoint with provided clientParams on behalf of the OpenSearch Dashboards internal user. See LegacyAPICaller. | 
Methods
| Method | Modifiers | Description | 
|---|---|---|
| asScoped(request) | Creates an instance of ILegacyScopedClusterClient based on the configuration the current cluster client that exposes additional callAsCurrentUsermethod scoped to the provided req. Consumers shouldn't worry about closing scoped client instances, these will be automatically closed as soon as the original cluster client isn't needed anymore and closed. | |
| close() | Closes the cluster client. After that client cannot be used and one should create a new client instance to be able to interact with OpenSearch API. |