@algolia/monitoring 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builds/browser.d.ts +6 -0
- package/dist/builds/browser.d.ts.map +1 -0
- package/dist/builds/node.d.ts +6 -0
- package/dist/builds/node.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +121 -0
- package/dist/model/clientMethodProps.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +7 -0
- package/dist/model/errorBase.d.ts.map +1 -0
- package/dist/model/getInventory403Response.d.ts +4 -0
- package/dist/model/getInventory403Response.d.ts.map +1 -0
- package/dist/model/incident.d.ts +12 -0
- package/dist/model/incident.d.ts.map +1 -0
- package/dist/model/incidentsInner.d.ts +9 -0
- package/dist/model/incidentsInner.d.ts.map +1 -0
- package/dist/model/incidentsResponse.d.ts +5 -0
- package/dist/model/incidentsResponse.d.ts.map +1 -0
- package/dist/model/index.d.ts +24 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/indexingTimeResponse.d.ts +5 -0
- package/dist/model/indexingTimeResponse.d.ts.map +1 -0
- package/dist/model/indexingTimeResponseMetrics.d.ts +5 -0
- package/dist/model/indexingTimeResponseMetrics.d.ts.map +1 -0
- package/dist/model/infrastructureResponse.d.ts +5 -0
- package/dist/model/infrastructureResponse.d.ts.map +1 -0
- package/dist/model/infrastructureResponseMetrics.d.ts +24 -0
- package/dist/model/infrastructureResponseMetrics.d.ts.map +1 -0
- package/dist/model/inventoryResponse.d.ts +5 -0
- package/dist/model/inventoryResponse.d.ts.map +1 -0
- package/dist/model/latencyResponse.d.ts +5 -0
- package/dist/model/latencyResponse.d.ts.map +1 -0
- package/dist/model/latencyResponseMetrics.d.ts +5 -0
- package/dist/model/latencyResponseMetrics.d.ts.map +1 -0
- package/dist/model/metric.d.ts +2 -0
- package/dist/model/metric.d.ts.map +1 -0
- package/dist/model/period.d.ts +2 -0
- package/dist/model/period.d.ts.map +1 -0
- package/dist/model/probesMetric.d.ts +11 -0
- package/dist/model/probesMetric.d.ts.map +1 -0
- package/dist/model/region.d.ts +5 -0
- package/dist/model/region.d.ts.map +1 -0
- package/dist/model/server.d.ts +25 -0
- package/dist/model/server.d.ts.map +1 -0
- package/dist/model/serverStatus.d.ts +2 -0
- package/dist/model/serverStatus.d.ts.map +1 -0
- package/dist/model/status.d.ts +5 -0
- package/dist/model/status.d.ts.map +1 -0
- package/dist/model/statusResponse.d.ts +5 -0
- package/dist/model/statusResponse.d.ts.map +1 -0
- package/dist/model/timeInner.d.ts +11 -0
- package/dist/model/timeInner.d.ts.map +1 -0
- package/dist/model/type.d.ts +2 -0
- package/dist/model/type.d.ts.map +1 -0
- package/dist/monitoring.cjs.js +416 -0
- package/dist/monitoring.esm.browser.js +1090 -0
- package/dist/monitoring.esm.node.js +413 -0
- package/dist/monitoring.umd.js +2 -0
- package/dist/src/monitoringClient.d.ts +154 -0
- package/dist/src/monitoringClient.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/model/clientMethodProps.ts +132 -0
- package/model/errorBase.ts +8 -0
- package/model/getInventory403Response.ts +5 -0
- package/model/incident.ts +15 -0
- package/model/incidentsInner.ts +12 -0
- package/model/incidentsResponse.ts +7 -0
- package/model/index.ts +25 -0
- package/model/indexingTimeResponse.ts +7 -0
- package/model/indexingTimeResponseMetrics.ts +7 -0
- package/model/infrastructureResponse.ts +7 -0
- package/model/infrastructureResponseMetrics.ts +30 -0
- package/model/inventoryResponse.ts +7 -0
- package/model/latencyResponse.ts +7 -0
- package/model/latencyResponseMetrics.ts +7 -0
- package/model/metric.ts +9 -0
- package/model/period.ts +3 -0
- package/model/probesMetric.ts +13 -0
- package/model/region.ts +21 -0
- package/model/server.ts +33 -0
- package/model/serverStatus.ts +3 -0
- package/model/status.ts +10 -0
- package/model/statusResponse.ts +7 -0
- package/model/timeInner.ts +13 -0
- package/model/type.ts +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
|
|
2
|
+
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
|
+
|
|
4
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
5
|
+
const apiClientVersion = '1.0.0-alpha.3';
|
|
6
|
+
function getDefaultHosts(appId) {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
url: `${appId}-dsn.algolia.net`,
|
|
10
|
+
accept: 'read',
|
|
11
|
+
protocol: 'https',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
url: `${appId}.algolia.net`,
|
|
15
|
+
accept: 'write',
|
|
16
|
+
protocol: 'https',
|
|
17
|
+
},
|
|
18
|
+
].concat(shuffle([
|
|
19
|
+
{
|
|
20
|
+
url: `${appId}-1.algolianet.com`,
|
|
21
|
+
accept: 'readWrite',
|
|
22
|
+
protocol: 'https',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
url: `${appId}-2.algolianet.com`,
|
|
26
|
+
accept: 'readWrite',
|
|
27
|
+
protocol: 'https',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
url: `${appId}-3.algolianet.com`,
|
|
31
|
+
accept: 'readWrite',
|
|
32
|
+
protocol: 'https',
|
|
33
|
+
},
|
|
34
|
+
]));
|
|
35
|
+
}
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
37
|
+
function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
38
|
+
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
39
|
+
const transporter = createTransporter({
|
|
40
|
+
hosts: getDefaultHosts(appIdOption),
|
|
41
|
+
...options,
|
|
42
|
+
algoliaAgent: getAlgoliaAgent({
|
|
43
|
+
algoliaAgents,
|
|
44
|
+
client: 'Monitoring',
|
|
45
|
+
version: apiClientVersion,
|
|
46
|
+
}),
|
|
47
|
+
baseHeaders: {
|
|
48
|
+
'content-type': 'text/plain',
|
|
49
|
+
...auth.headers(),
|
|
50
|
+
...options.baseHeaders,
|
|
51
|
+
},
|
|
52
|
+
baseQueryParameters: {
|
|
53
|
+
...auth.queryParameters(),
|
|
54
|
+
...options.baseQueryParameters,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
transporter,
|
|
59
|
+
/**
|
|
60
|
+
* The `appId` currently in use.
|
|
61
|
+
*/
|
|
62
|
+
appId: appIdOption,
|
|
63
|
+
/**
|
|
64
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
65
|
+
*/
|
|
66
|
+
clearCache() {
|
|
67
|
+
return Promise.all([
|
|
68
|
+
transporter.requestsCache.clear(),
|
|
69
|
+
transporter.responsesCache.clear(),
|
|
70
|
+
]).then(() => undefined);
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
74
|
+
*/
|
|
75
|
+
get _ua() {
|
|
76
|
+
return transporter.algoliaAgent.value;
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
80
|
+
*
|
|
81
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
82
|
+
* @param version - The version of the agent.
|
|
83
|
+
*/
|
|
84
|
+
addAlgoliaAgent(segment, version) {
|
|
85
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
89
|
+
*
|
|
90
|
+
* @summary Send requests to the Algolia REST API.
|
|
91
|
+
* @param del - The del object.
|
|
92
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
93
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
94
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
95
|
+
*/
|
|
96
|
+
del({ path, parameters }, requestOptions) {
|
|
97
|
+
if (!path) {
|
|
98
|
+
throw new Error('Parameter `path` is required when calling `del`.');
|
|
99
|
+
}
|
|
100
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
101
|
+
const headers = {};
|
|
102
|
+
const queryParameters = parameters ? parameters : {};
|
|
103
|
+
const request = {
|
|
104
|
+
method: 'DELETE',
|
|
105
|
+
path: requestPath,
|
|
106
|
+
queryParameters,
|
|
107
|
+
headers,
|
|
108
|
+
};
|
|
109
|
+
return transporter.request(request, requestOptions);
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
113
|
+
*
|
|
114
|
+
* @summary Send requests to the Algolia REST API.
|
|
115
|
+
* @param get - The get object.
|
|
116
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
117
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
118
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
119
|
+
*/
|
|
120
|
+
get({ path, parameters }, requestOptions) {
|
|
121
|
+
if (!path) {
|
|
122
|
+
throw new Error('Parameter `path` is required when calling `get`.');
|
|
123
|
+
}
|
|
124
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
125
|
+
const headers = {};
|
|
126
|
+
const queryParameters = parameters ? parameters : {};
|
|
127
|
+
const request = {
|
|
128
|
+
method: 'GET',
|
|
129
|
+
path: requestPath,
|
|
130
|
+
queryParameters,
|
|
131
|
+
headers,
|
|
132
|
+
};
|
|
133
|
+
return transporter.request(request, requestOptions);
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* List known incidents for selected clusters.
|
|
137
|
+
*
|
|
138
|
+
* @summary List incidents for selected clusters.
|
|
139
|
+
* @param getClusterIncidents - The getClusterIncidents object.
|
|
140
|
+
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
141
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
142
|
+
*/
|
|
143
|
+
getClusterIncidents({ clusters }, requestOptions) {
|
|
144
|
+
if (!clusters) {
|
|
145
|
+
throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');
|
|
146
|
+
}
|
|
147
|
+
const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
148
|
+
const headers = {};
|
|
149
|
+
const queryParameters = {};
|
|
150
|
+
const request = {
|
|
151
|
+
method: 'GET',
|
|
152
|
+
path: requestPath,
|
|
153
|
+
queryParameters,
|
|
154
|
+
headers,
|
|
155
|
+
};
|
|
156
|
+
return transporter.request(request, requestOptions);
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Report whether a cluster is operational.
|
|
160
|
+
*
|
|
161
|
+
* @summary List statuses of selected clusters.
|
|
162
|
+
* @param getClusterStatus - The getClusterStatus object.
|
|
163
|
+
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
164
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
165
|
+
*/
|
|
166
|
+
getClusterStatus({ clusters }, requestOptions) {
|
|
167
|
+
if (!clusters) {
|
|
168
|
+
throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');
|
|
169
|
+
}
|
|
170
|
+
const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
171
|
+
const headers = {};
|
|
172
|
+
const queryParameters = {};
|
|
173
|
+
const request = {
|
|
174
|
+
method: 'GET',
|
|
175
|
+
path: requestPath,
|
|
176
|
+
queryParameters,
|
|
177
|
+
headers,
|
|
178
|
+
};
|
|
179
|
+
return transporter.request(request, requestOptions);
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* List known incidents for all clusters.
|
|
183
|
+
*
|
|
184
|
+
* @summary List incidents.
|
|
185
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
186
|
+
*/
|
|
187
|
+
getIncidents(requestOptions) {
|
|
188
|
+
const requestPath = '/1/incidents';
|
|
189
|
+
const headers = {};
|
|
190
|
+
const queryParameters = {};
|
|
191
|
+
const request = {
|
|
192
|
+
method: 'GET',
|
|
193
|
+
path: requestPath,
|
|
194
|
+
queryParameters,
|
|
195
|
+
headers,
|
|
196
|
+
};
|
|
197
|
+
return transporter.request(request, requestOptions);
|
|
198
|
+
},
|
|
199
|
+
/**
|
|
200
|
+
* List the average times for indexing operations for selected clusters.
|
|
201
|
+
*
|
|
202
|
+
* @summary Get indexing times.
|
|
203
|
+
* @param getIndexingTime - The getIndexingTime object.
|
|
204
|
+
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
205
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
206
|
+
*/
|
|
207
|
+
getIndexingTime({ clusters }, requestOptions) {
|
|
208
|
+
if (!clusters) {
|
|
209
|
+
throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');
|
|
210
|
+
}
|
|
211
|
+
const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
212
|
+
const headers = {};
|
|
213
|
+
const queryParameters = {};
|
|
214
|
+
const request = {
|
|
215
|
+
method: 'GET',
|
|
216
|
+
path: requestPath,
|
|
217
|
+
queryParameters,
|
|
218
|
+
headers,
|
|
219
|
+
};
|
|
220
|
+
return transporter.request(request, requestOptions);
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* List the servers belonging to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
|
|
224
|
+
*
|
|
225
|
+
* @summary List servers.
|
|
226
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
227
|
+
*/
|
|
228
|
+
getInventory(requestOptions) {
|
|
229
|
+
const requestPath = '/1/inventory/servers';
|
|
230
|
+
const headers = {};
|
|
231
|
+
const queryParameters = {};
|
|
232
|
+
const request = {
|
|
233
|
+
method: 'GET',
|
|
234
|
+
path: requestPath,
|
|
235
|
+
queryParameters,
|
|
236
|
+
headers,
|
|
237
|
+
};
|
|
238
|
+
return transporter.request(request, requestOptions);
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* List the average latency for search requests for selected clusters.
|
|
242
|
+
*
|
|
243
|
+
* @summary Get search latency times.
|
|
244
|
+
* @param getLatency - The getLatency object.
|
|
245
|
+
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
246
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
247
|
+
*/
|
|
248
|
+
getLatency({ clusters }, requestOptions) {
|
|
249
|
+
if (!clusters) {
|
|
250
|
+
throw new Error('Parameter `clusters` is required when calling `getLatency`.');
|
|
251
|
+
}
|
|
252
|
+
const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
253
|
+
const headers = {};
|
|
254
|
+
const queryParameters = {};
|
|
255
|
+
const request = {
|
|
256
|
+
method: 'GET',
|
|
257
|
+
path: requestPath,
|
|
258
|
+
queryParameters,
|
|
259
|
+
headers,
|
|
260
|
+
};
|
|
261
|
+
return transporter.request(request, requestOptions);
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* Report the aggregate value of a metric for a selected period of time.
|
|
265
|
+
*
|
|
266
|
+
* @summary Get metrics for a given period.
|
|
267
|
+
* @param getMetrics - The getMetrics object.
|
|
268
|
+
* @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the response. To include all metrics, use `*` as the parameter.
|
|
269
|
+
* @param getMetrics.period - Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day.
|
|
270
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
271
|
+
*/
|
|
272
|
+
getMetrics({ metric, period }, requestOptions) {
|
|
273
|
+
if (!metric) {
|
|
274
|
+
throw new Error('Parameter `metric` is required when calling `getMetrics`.');
|
|
275
|
+
}
|
|
276
|
+
if (!period) {
|
|
277
|
+
throw new Error('Parameter `period` is required when calling `getMetrics`.');
|
|
278
|
+
}
|
|
279
|
+
const requestPath = '/1/infrastructure/{metric}/period/{period}'
|
|
280
|
+
.replace('{metric}', encodeURIComponent(metric))
|
|
281
|
+
.replace('{period}', encodeURIComponent(period));
|
|
282
|
+
const headers = {};
|
|
283
|
+
const queryParameters = {};
|
|
284
|
+
const request = {
|
|
285
|
+
method: 'GET',
|
|
286
|
+
path: requestPath,
|
|
287
|
+
queryParameters,
|
|
288
|
+
headers,
|
|
289
|
+
};
|
|
290
|
+
return transporter.request(request, requestOptions);
|
|
291
|
+
},
|
|
292
|
+
/**
|
|
293
|
+
* Test whether clusters are reachable or not.
|
|
294
|
+
*
|
|
295
|
+
* @summary Test the reachability of clusters.
|
|
296
|
+
* @param getReachability - The getReachability object.
|
|
297
|
+
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
298
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
299
|
+
*/
|
|
300
|
+
getReachability({ clusters }, requestOptions) {
|
|
301
|
+
if (!clusters) {
|
|
302
|
+
throw new Error('Parameter `clusters` is required when calling `getReachability`.');
|
|
303
|
+
}
|
|
304
|
+
const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));
|
|
305
|
+
const headers = {};
|
|
306
|
+
const queryParameters = {};
|
|
307
|
+
const request = {
|
|
308
|
+
method: 'GET',
|
|
309
|
+
path: requestPath,
|
|
310
|
+
queryParameters,
|
|
311
|
+
headers,
|
|
312
|
+
};
|
|
313
|
+
return transporter.request(request, requestOptions);
|
|
314
|
+
},
|
|
315
|
+
/**
|
|
316
|
+
* Report whether clusters are operational. The response depends on whether you authenticate your API request. - With authentication, the response includes the status of the cluster assigned to your Algolia application. - Without authentication, the response lists the statuses of all public Algolia clusters.
|
|
317
|
+
*
|
|
318
|
+
* @summary List cluster statuses.
|
|
319
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
320
|
+
*/
|
|
321
|
+
getStatus(requestOptions) {
|
|
322
|
+
const requestPath = '/1/status';
|
|
323
|
+
const headers = {};
|
|
324
|
+
const queryParameters = {};
|
|
325
|
+
const request = {
|
|
326
|
+
method: 'GET',
|
|
327
|
+
path: requestPath,
|
|
328
|
+
queryParameters,
|
|
329
|
+
headers,
|
|
330
|
+
};
|
|
331
|
+
return transporter.request(request, requestOptions);
|
|
332
|
+
},
|
|
333
|
+
/**
|
|
334
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
335
|
+
*
|
|
336
|
+
* @summary Send requests to the Algolia REST API.
|
|
337
|
+
* @param post - The post object.
|
|
338
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
339
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
340
|
+
* @param post.body - Parameters to send with the custom request.
|
|
341
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
342
|
+
*/
|
|
343
|
+
post({ path, parameters, body }, requestOptions) {
|
|
344
|
+
if (!path) {
|
|
345
|
+
throw new Error('Parameter `path` is required when calling `post`.');
|
|
346
|
+
}
|
|
347
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
348
|
+
const headers = {};
|
|
349
|
+
const queryParameters = parameters ? parameters : {};
|
|
350
|
+
const request = {
|
|
351
|
+
method: 'POST',
|
|
352
|
+
path: requestPath,
|
|
353
|
+
queryParameters,
|
|
354
|
+
headers,
|
|
355
|
+
data: body ? body : {},
|
|
356
|
+
};
|
|
357
|
+
return transporter.request(request, requestOptions);
|
|
358
|
+
},
|
|
359
|
+
/**
|
|
360
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
361
|
+
*
|
|
362
|
+
* @summary Send requests to the Algolia REST API.
|
|
363
|
+
* @param put - The put object.
|
|
364
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
365
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
366
|
+
* @param put.body - Parameters to send with the custom request.
|
|
367
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
368
|
+
*/
|
|
369
|
+
put({ path, parameters, body }, requestOptions) {
|
|
370
|
+
if (!path) {
|
|
371
|
+
throw new Error('Parameter `path` is required when calling `put`.');
|
|
372
|
+
}
|
|
373
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
374
|
+
const headers = {};
|
|
375
|
+
const queryParameters = parameters ? parameters : {};
|
|
376
|
+
const request = {
|
|
377
|
+
method: 'PUT',
|
|
378
|
+
path: requestPath,
|
|
379
|
+
queryParameters,
|
|
380
|
+
headers,
|
|
381
|
+
data: body ? body : {},
|
|
382
|
+
};
|
|
383
|
+
return transporter.request(request, requestOptions);
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
389
|
+
function monitoringClient(appId, apiKey, options) {
|
|
390
|
+
if (!appId || typeof appId !== 'string') {
|
|
391
|
+
throw new Error('`appId` is missing.');
|
|
392
|
+
}
|
|
393
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
394
|
+
throw new Error('`apiKey` is missing.');
|
|
395
|
+
}
|
|
396
|
+
return createMonitoringClient({
|
|
397
|
+
appId,
|
|
398
|
+
apiKey,
|
|
399
|
+
timeouts: {
|
|
400
|
+
connect: DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
401
|
+
read: DEFAULT_READ_TIMEOUT_NODE,
|
|
402
|
+
write: DEFAULT_WRITE_TIMEOUT_NODE,
|
|
403
|
+
},
|
|
404
|
+
requester: createHttpRequester(),
|
|
405
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
406
|
+
responsesCache: createNullCache(),
|
|
407
|
+
requestsCache: createNullCache(),
|
|
408
|
+
hostsCache: createMemoryCache(),
|
|
409
|
+
...options,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export { apiClientVersion, monitoringClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! monitoring.umd.js | 1.0.0-alpha.3 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/monitoring"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},v={...s,...c.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:c.method,url:m(s,c.path,v),connectTimeout:r(b,o.connect),responseTimeout:r(b,a)},E=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},O=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const a=E(O);return O.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,O.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(O);throw E(O),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(O,y)},E=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(E);return T([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="1.0.0-alpha.3";function P(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const s=Math.floor(Math.random()*(r+1)),a=e[r];t[r]=e[s],t[s]=a}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=y,e.monitoringClient=function(e,a,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,...a}){const n=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),o=g({hosts:P(e),...a,algoliaAgent:f({algoliaAgents:s,client:"Monitoring",version:y}),baseHeaders:{"content-type":"text/plain",...n.headers(),...a.baseHeaders},baseQueryParameters:{...n.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((()=>{})),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},getClusterIncidents({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const r={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getClusterStatus({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const r={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getIncidents(e){const t={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return o.request(t,e)},getIndexingTime({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const r={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getInventory(e){const t={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return o.request(t,e)},getLatency({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const r={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getMetrics({metric:e,period:t},r){if(!e)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!t)throw new Error("Parameter `period` is required when calling `getMetrics`.");const s={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(e)).replace("{period}",encodeURIComponent(t)),queryParameters:{},headers:{}};return o.request(s,r)},getReachability({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const r={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getStatus(e){const t={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return o.request(t,e)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)}}}({appId:e,apiKey:a,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...n})}}));
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
+
import type { DelProps, GetProps, GetClusterIncidentsProps, GetClusterStatusProps, GetIndexingTimeProps, GetLatencyProps, GetMetricsProps, GetReachabilityProps, PostProps, PutProps } from '../model/clientMethodProps';
|
|
3
|
+
import type { IncidentsResponse } from '../model/incidentsResponse';
|
|
4
|
+
import type { IndexingTimeResponse } from '../model/indexingTimeResponse';
|
|
5
|
+
import type { InfrastructureResponse } from '../model/infrastructureResponse';
|
|
6
|
+
import type { InventoryResponse } from '../model/inventoryResponse';
|
|
7
|
+
import type { LatencyResponse } from '../model/latencyResponse';
|
|
8
|
+
import type { StatusResponse } from '../model/statusResponse';
|
|
9
|
+
export declare const apiClientVersion = "1.0.0-alpha.3";
|
|
10
|
+
export declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
|
+
transporter: import("@algolia/client-common").Transporter;
|
|
12
|
+
/**
|
|
13
|
+
* The `appId` currently in use.
|
|
14
|
+
*/
|
|
15
|
+
appId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
18
|
+
*/
|
|
19
|
+
clearCache(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
22
|
+
*/
|
|
23
|
+
readonly _ua: string;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
26
|
+
*
|
|
27
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
28
|
+
* @param version - The version of the agent.
|
|
29
|
+
*/
|
|
30
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
33
|
+
*
|
|
34
|
+
* @summary Send requests to the Algolia REST API.
|
|
35
|
+
* @param del - The del object.
|
|
36
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
37
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
38
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
|
+
*/
|
|
40
|
+
del({ path, parameters }: DelProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
|
+
/**
|
|
42
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
43
|
+
*
|
|
44
|
+
* @summary Send requests to the Algolia REST API.
|
|
45
|
+
* @param get - The get object.
|
|
46
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
47
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
48
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
|
+
*/
|
|
50
|
+
get({ path, parameters }: GetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
|
+
/**
|
|
52
|
+
* List known incidents for selected clusters.
|
|
53
|
+
*
|
|
54
|
+
* @summary List incidents for selected clusters.
|
|
55
|
+
* @param getClusterIncidents - The getClusterIncidents object.
|
|
56
|
+
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
57
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
58
|
+
*/
|
|
59
|
+
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Report whether a cluster is operational.
|
|
62
|
+
*
|
|
63
|
+
* @summary List statuses of selected clusters.
|
|
64
|
+
* @param getClusterStatus - The getClusterStatus object.
|
|
65
|
+
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
66
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
67
|
+
*/
|
|
68
|
+
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* List known incidents for all clusters.
|
|
71
|
+
*
|
|
72
|
+
* @summary List incidents.
|
|
73
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
74
|
+
*/
|
|
75
|
+
getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* List the average times for indexing operations for selected clusters.
|
|
78
|
+
*
|
|
79
|
+
* @summary Get indexing times.
|
|
80
|
+
* @param getIndexingTime - The getIndexingTime object.
|
|
81
|
+
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
82
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
83
|
+
*/
|
|
84
|
+
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* List the servers belonging to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
|
|
87
|
+
*
|
|
88
|
+
* @summary List servers.
|
|
89
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
90
|
+
*/
|
|
91
|
+
getInventory(requestOptions?: RequestOptions): Promise<InventoryResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* List the average latency for search requests for selected clusters.
|
|
94
|
+
*
|
|
95
|
+
* @summary Get search latency times.
|
|
96
|
+
* @param getLatency - The getLatency object.
|
|
97
|
+
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
98
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
99
|
+
*/
|
|
100
|
+
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* Report the aggregate value of a metric for a selected period of time.
|
|
103
|
+
*
|
|
104
|
+
* @summary Get metrics for a given period.
|
|
105
|
+
* @param getMetrics - The getMetrics object.
|
|
106
|
+
* @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the response. To include all metrics, use `*` as the parameter.
|
|
107
|
+
* @param getMetrics.period - Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day.
|
|
108
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
109
|
+
*/
|
|
110
|
+
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Test whether clusters are reachable or not.
|
|
113
|
+
*
|
|
114
|
+
* @summary Test the reachability of clusters.
|
|
115
|
+
* @param getReachability - The getReachability object.
|
|
116
|
+
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
117
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
118
|
+
*/
|
|
119
|
+
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<Record<string, Record<string, boolean>>>;
|
|
120
|
+
/**
|
|
121
|
+
* Report whether clusters are operational. The response depends on whether you authenticate your API request. - With authentication, the response includes the status of the cluster assigned to your Algolia application. - Without authentication, the response lists the statuses of all public Algolia clusters.
|
|
122
|
+
*
|
|
123
|
+
* @summary List cluster statuses.
|
|
124
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
125
|
+
*/
|
|
126
|
+
getStatus(requestOptions?: RequestOptions): Promise<StatusResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
129
|
+
*
|
|
130
|
+
* @summary Send requests to the Algolia REST API.
|
|
131
|
+
* @param post - The post object.
|
|
132
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
133
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
134
|
+
* @param post.body - Parameters to send with the custom request.
|
|
135
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
136
|
+
*/
|
|
137
|
+
post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
138
|
+
/**
|
|
139
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
140
|
+
*
|
|
141
|
+
* @summary Send requests to the Algolia REST API.
|
|
142
|
+
* @param put - The put object.
|
|
143
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
144
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
145
|
+
* @param put.body - Parameters to send with the custom request.
|
|
146
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
147
|
+
*/
|
|
148
|
+
put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* The client type.
|
|
152
|
+
*/
|
|
153
|
+
export type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
|
154
|
+
//# sourceMappingURL=monitoringClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitoringClient.d.ts","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAsChD,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,GAAG,OAAO,EACX,EAAE,mBAAmB;;IAwBlB;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;OAOG;sCAEa,wBAAwB,mBACrB,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAwB7B;;;;;;;OAOG;mCAEa,qBAAqB,mBAClB,cAAc,GAC9B,QAAQ,cAAc,CAAC;IAwB1B;;;;;OAKG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;;OAOG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,oBAAoB,CAAC;IAwBhC;;;;;OAKG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;;OAOG;6BAEa,eAAe,mBACZ,cAAc,GAC9B,QAAQ,eAAe,CAAC;IAwB3B;;;;;;;;OAQG;mCAEmB,eAAe,mBAClB,cAAc,GAC9B,QAAQ,sBAAsB,CAAC;IA6BlC;;;;;;;OAOG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAwBnD;;;;;OAKG;+BACwB,cAAc,GAAG,QAAQ,cAAc,CAAC;IAenE;;;;;;;;;OASG;qCAE2B,SAAS,mBACpB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAoB/B;;;;;;;;;OASG;oCAE2B,QAAQ,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;EAoBlC;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/index.d.ts
ADDED
package/index.js
ADDED