@algolia/monitoring 1.0.0-alpha.8 → 1.0.0-beta.1

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.
@@ -4,42 +4,17 @@ var clientCommon = require('@algolia/client-common');
4
4
  var requesterNodeHttp = require('@algolia/requester-node-http');
5
5
 
6
6
  // 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.
7
- const apiClientVersion = '1.0.0-alpha.8';
8
- function getDefaultHosts(appId) {
7
+ const apiClientVersion = '1.0.0-beta.1';
8
+ function getDefaultHosts() {
9
9
  return [
10
- {
11
- url: `${appId}-dsn.algolia.net`,
12
- accept: 'read',
13
- protocol: 'https',
14
- },
15
- {
16
- url: `${appId}.algolia.net`,
17
- accept: 'write',
18
- protocol: 'https',
19
- },
20
- ].concat(clientCommon.shuffle([
21
- {
22
- url: `${appId}-1.algolianet.com`,
23
- accept: 'readWrite',
24
- protocol: 'https',
25
- },
26
- {
27
- url: `${appId}-2.algolianet.com`,
28
- accept: 'readWrite',
29
- protocol: 'https',
30
- },
31
- {
32
- url: `${appId}-3.algolianet.com`,
33
- accept: 'readWrite',
34
- protocol: 'https',
35
- },
36
- ]));
10
+ { url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' },
11
+ ];
37
12
  }
38
13
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
39
14
  function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
40
15
  const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
41
16
  const transporter = clientCommon.createTransporter({
42
- hosts: getDefaultHosts(appIdOption),
17
+ hosts: getDefaultHosts(),
43
18
  ...options,
44
19
  algoliaAgent: clientCommon.getAlgoliaAgent({
45
20
  algoliaAgents,
@@ -89,17 +64,16 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
89
64
  /**
90
65
  * This method allow you to send requests to the Algolia REST API.
91
66
  *
92
- * @summary Send requests to the Algolia REST API.
93
- * @param del - The del object.
94
- * @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
95
- * @param del.parameters - Query parameters to apply to the current query.
67
+ * @param customDelete - The customDelete object.
68
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
69
+ * @param customDelete.parameters - Query parameters to apply to the current query.
96
70
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
97
71
  */
98
- del({ path, parameters }, requestOptions) {
72
+ customDelete({ path, parameters }, requestOptions) {
99
73
  if (!path) {
100
- throw new Error('Parameter `path` is required when calling `del`.');
74
+ throw new Error('Parameter `path` is required when calling `customDelete`.');
101
75
  }
102
- const requestPath = '/1{path}'.replace('{path}', path);
76
+ const requestPath = '/{path}'.replace('{path}', path);
103
77
  const headers = {};
104
78
  const queryParameters = parameters ? parameters : {};
105
79
  const request = {
@@ -113,17 +87,16 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
113
87
  /**
114
88
  * This method allow you to send requests to the Algolia REST API.
115
89
  *
116
- * @summary Send requests to the Algolia REST API.
117
- * @param get - The get object.
118
- * @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
119
- * @param get.parameters - Query parameters to apply to the current query.
90
+ * @param customGet - The customGet object.
91
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
92
+ * @param customGet.parameters - Query parameters to apply to the current query.
120
93
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
121
94
  */
122
- get({ path, parameters }, requestOptions) {
95
+ customGet({ path, parameters }, requestOptions) {
123
96
  if (!path) {
124
- throw new Error('Parameter `path` is required when calling `get`.');
97
+ throw new Error('Parameter `path` is required when calling `customGet`.');
125
98
  }
126
- const requestPath = '/1{path}'.replace('{path}', path);
99
+ const requestPath = '/{path}'.replace('{path}', path);
127
100
  const headers = {};
128
101
  const queryParameters = parameters ? parameters : {};
129
102
  const request = {
@@ -135,9 +108,58 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
135
108
  return transporter.request(request, requestOptions);
136
109
  },
137
110
  /**
138
- * List known incidents for selected clusters.
111
+ * This method allow you to send requests to the Algolia REST API.
112
+ *
113
+ * @param customPost - The customPost object.
114
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
115
+ * @param customPost.parameters - Query parameters to apply to the current query.
116
+ * @param customPost.body - Parameters to send with the custom request.
117
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
118
+ */
119
+ customPost({ path, parameters, body }, requestOptions) {
120
+ if (!path) {
121
+ throw new Error('Parameter `path` is required when calling `customPost`.');
122
+ }
123
+ const requestPath = '/{path}'.replace('{path}', path);
124
+ const headers = {};
125
+ const queryParameters = parameters ? parameters : {};
126
+ const request = {
127
+ method: 'POST',
128
+ path: requestPath,
129
+ queryParameters,
130
+ headers,
131
+ data: body ? body : {},
132
+ };
133
+ return transporter.request(request, requestOptions);
134
+ },
135
+ /**
136
+ * This method allow you to send requests to the Algolia REST API.
137
+ *
138
+ * @param customPut - The customPut object.
139
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
140
+ * @param customPut.parameters - Query parameters to apply to the current query.
141
+ * @param customPut.body - Parameters to send with the custom request.
142
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
143
+ */
144
+ customPut({ path, parameters, body }, requestOptions) {
145
+ if (!path) {
146
+ throw new Error('Parameter `path` is required when calling `customPut`.');
147
+ }
148
+ const requestPath = '/{path}'.replace('{path}', path);
149
+ const headers = {};
150
+ const queryParameters = parameters ? parameters : {};
151
+ const request = {
152
+ method: 'PUT',
153
+ path: requestPath,
154
+ queryParameters,
155
+ headers,
156
+ data: body ? body : {},
157
+ };
158
+ return transporter.request(request, requestOptions);
159
+ },
160
+ /**
161
+ * Retrieves known incidents for the selected clusters.
139
162
  *
140
- * @summary List incidents for selected clusters.
141
163
  * @param getClusterIncidents - The getClusterIncidents object.
142
164
  * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
143
165
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -158,9 +180,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
158
180
  return transporter.request(request, requestOptions);
159
181
  },
160
182
  /**
161
- * Report whether a cluster is operational.
183
+ * Retrieves the status of selected clusters.
162
184
  *
163
- * @summary List statuses of selected clusters.
164
185
  * @param getClusterStatus - The getClusterStatus object.
165
186
  * @param getClusterStatus.clusters - Subset of clusters, separated by comma.
166
187
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -181,9 +202,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
181
202
  return transporter.request(request, requestOptions);
182
203
  },
183
204
  /**
184
- * List known incidents for all clusters.
205
+ * Retrieves known incidents for all clusters.
185
206
  *
186
- * @summary List incidents.
187
207
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
188
208
  */
189
209
  getIncidents(requestOptions) {
@@ -199,9 +219,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
199
219
  return transporter.request(request, requestOptions);
200
220
  },
201
221
  /**
202
- * List the average times for indexing operations for selected clusters.
222
+ * Retrieves average times for indexing operations for selected clusters.
203
223
  *
204
- * @summary Get indexing times.
205
224
  * @param getIndexingTime - The getIndexingTime object.
206
225
  * @param getIndexingTime.clusters - Subset of clusters, separated by comma.
207
226
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -222,27 +241,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
222
241
  return transporter.request(request, requestOptions);
223
242
  },
224
243
  /**
225
- * 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.
226
- *
227
- * @summary List servers.
228
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
229
- */
230
- getInventory(requestOptions) {
231
- const requestPath = '/1/inventory/servers';
232
- const headers = {};
233
- const queryParameters = {};
234
- const request = {
235
- method: 'GET',
236
- path: requestPath,
237
- queryParameters,
238
- headers,
239
- };
240
- return transporter.request(request, requestOptions);
241
- },
242
- /**
243
- * List the average latency for search requests for selected clusters.
244
+ * Retrieves the average latency for search requests for selected clusters.
244
245
  *
245
- * @summary Get search latency times.
246
246
  * @param getLatency - The getLatency object.
247
247
  * @param getLatency.clusters - Subset of clusters, separated by comma.
248
248
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -263,11 +263,10 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
263
263
  return transporter.request(request, requestOptions);
264
264
  },
265
265
  /**
266
- * Report the aggregate value of a metric for a selected period of time.
266
+ * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
267
267
  *
268
- * @summary Get metrics for a given period.
269
268
  * @param getMetrics - The getMetrics object.
270
- * @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.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
271
270
  * @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.
272
271
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
273
272
  */
@@ -294,7 +293,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
294
293
  /**
295
294
  * Test whether clusters are reachable or not.
296
295
  *
297
- * @summary Test the reachability of clusters.
298
296
  * @param getReachability - The getReachability object.
299
297
  * @param getReachability.clusters - Subset of clusters, separated by comma.
300
298
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -315,13 +313,12 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
315
313
  return transporter.request(request, requestOptions);
316
314
  },
317
315
  /**
318
- * 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.
316
+ * Retrieves the servers that belong 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.
319
317
  *
320
- * @summary List cluster statuses.
321
318
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
322
319
  */
323
- getStatus(requestOptions) {
324
- const requestPath = '/1/status';
320
+ getServers(requestOptions) {
321
+ const requestPath = '/1/inventory/servers';
325
322
  const headers = {};
326
323
  const queryParameters = {};
327
324
  const request = {
@@ -333,54 +330,19 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
333
330
  return transporter.request(request, requestOptions);
334
331
  },
335
332
  /**
336
- * This method allow you to send requests to the Algolia REST API.
333
+ * Retrieves the status of all Algolia clusters and instances.
337
334
  *
338
- * @summary Send requests to the Algolia REST API.
339
- * @param post - The post object.
340
- * @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
341
- * @param post.parameters - Query parameters to apply to the current query.
342
- * @param post.body - Parameters to send with the custom request.
343
335
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
344
336
  */
345
- post({ path, parameters, body }, requestOptions) {
346
- if (!path) {
347
- throw new Error('Parameter `path` is required when calling `post`.');
348
- }
349
- const requestPath = '/1{path}'.replace('{path}', path);
350
- const headers = {};
351
- const queryParameters = parameters ? parameters : {};
352
- const request = {
353
- method: 'POST',
354
- path: requestPath,
355
- queryParameters,
356
- headers,
357
- data: body ? body : {},
358
- };
359
- return transporter.request(request, requestOptions);
360
- },
361
- /**
362
- * This method allow you to send requests to the Algolia REST API.
363
- *
364
- * @summary Send requests to the Algolia REST API.
365
- * @param put - The put object.
366
- * @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
367
- * @param put.parameters - Query parameters to apply to the current query.
368
- * @param put.body - Parameters to send with the custom request.
369
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
370
- */
371
- put({ path, parameters, body }, requestOptions) {
372
- if (!path) {
373
- throw new Error('Parameter `path` is required when calling `put`.');
374
- }
375
- const requestPath = '/1{path}'.replace('{path}', path);
337
+ getStatus(requestOptions) {
338
+ const requestPath = '/1/status';
376
339
  const headers = {};
377
- const queryParameters = parameters ? parameters : {};
340
+ const queryParameters = {};
378
341
  const request = {
379
- method: 'PUT',
342
+ method: 'GET',
380
343
  path: requestPath,
381
344
  queryParameters,
382
345
  headers,
383
- data: body ? body : {},
384
346
  };
385
347
  return transporter.request(request, requestOptions);
386
348
  },
@@ -388,6 +350,7 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
388
350
  }
389
351
 
390
352
  // 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.
353
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
391
354
  function monitoringClient(appId, apiKey, options) {
392
355
  if (!appId || typeof appId !== 'string') {
393
356
  throw new Error('`appId` is missing.');
@@ -395,21 +358,23 @@ function monitoringClient(appId, apiKey, options) {
395
358
  if (!apiKey || typeof apiKey !== 'string') {
396
359
  throw new Error('`apiKey` is missing.');
397
360
  }
398
- return createMonitoringClient({
399
- appId,
400
- apiKey,
401
- timeouts: {
402
- connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
403
- read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
404
- write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
405
- },
406
- requester: requesterNodeHttp.createHttpRequester(),
407
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
408
- responsesCache: clientCommon.createNullCache(),
409
- requestsCache: clientCommon.createNullCache(),
410
- hostsCache: clientCommon.createMemoryCache(),
411
- ...options,
412
- });
361
+ return {
362
+ ...createMonitoringClient({
363
+ appId,
364
+ apiKey,
365
+ timeouts: {
366
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
367
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
368
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
369
+ },
370
+ requester: requesterNodeHttp.createHttpRequester(),
371
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
372
+ responsesCache: clientCommon.createNullCache(),
373
+ requestsCache: clientCommon.createNullCache(),
374
+ hostsCache: clientCommon.createMemoryCache(),
375
+ ...options,
376
+ }),
377
+ };
413
378
  }
414
379
 
415
380
  exports.apiClientVersion = apiClientVersion;