File tree Expand file tree Collapse file tree
x-pack/plugins/licensing/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7+ /** @public */
78export interface FeatureUsageServiceSetup {
9+ /**
10+ * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}.
11+ */
812 register ( featureName : string ) : void ;
913}
14+
15+ /** @public */
1016export interface FeatureUsageServiceStart {
17+ /**
18+ * Notify of a registered feature usage at given time.
19+ * If `usedAt` is not specified, it will use the current time instead.
20+ */
1121 notifyUsage ( featureName : string , usedAt ?: number ) : void ;
22+ /**
23+ * Return a map containing last usage timestamp for all features.
24+ * Features that were not used yet do not appear in the map.
25+ */
1226 getLastUsages ( ) : ReadonlyMap < string , number > ;
27+ /**
28+ * Clear all usage records from the service.
29+ */
1330 clear ( ) : void ;
1431}
1532
Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ export interface LicensingPluginSetup {
5858 * Triggers licensing information re-fetch.
5959 */
6060 refresh ( ) : Promise < ILicense > ;
61-
6261 /**
6362 * Creates a license poller to retrieve a license data with.
6463 * Allows a plugin to configure a cluster to retrieve data from at
@@ -68,17 +67,16 @@ export interface LicensingPluginSetup {
6867 clusterClient : IClusterClient ,
6968 pollingFrequency : number
7069 ) => { license$ : Observable < ILicense > ; refresh ( ) : Promise < ILicense > } ;
71-
7270 /**
73- * TODO
71+ * APIs to register licensed feature usage.
7472 */
7573 featureUsage : FeatureUsageServiceSetup ;
7674}
7775
7876/** @public */
7977export interface LicensingPluginStart {
8078 /**
81- * TODO
79+ * APIs to manage licensed feature usage.
8280 */
8381 featureUsage : FeatureUsageServiceStart ;
8482}
You can’t perform that action at this time.
0 commit comments