@algolia/monitoring 1.0.0-alpha.9 → 1.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +25 -3
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +25 -3
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +39 -39
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/getServers403Response.d.ts +4 -0
- package/dist/model/getServers403Response.d.ts.map +1 -0
- package/dist/model/incidentsInner.d.ts +1 -1
- package/dist/model/index.d.ts +1 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/probesMetric.d.ts +1 -1
- package/dist/model/region.d.ts +1 -1
- package/dist/model/server.d.ts +2 -2
- package/dist/model/timeInner.d.ts +1 -1
- package/dist/monitoring.cjs +100 -135
- package/dist/monitoring.esm.browser.js +133 -167
- package/dist/monitoring.esm.node.js +101 -136
- package/dist/monitoring.umd.js +2 -2
- package/dist/src/monitoringClient.d.ts +41 -58
- package/dist/src/monitoringClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +41 -41
- package/model/{getInventory403Response.ts → getServers403Response.ts} +1 -1
- package/model/incidentsInner.ts +1 -1
- package/model/index.ts +1 -1
- package/model/probesMetric.ts +1 -1
- package/model/region.ts +1 -1
- package/model/server.ts +2 -2
- package/model/timeInner.ts +1 -1
- package/package.json +11 -8
- package/dist/model/getInventory403Response.d.ts +0 -4
- package/dist/model/getInventory403Response.d.ts.map +0 -1
|
@@ -26,14 +26,35 @@ function createBrowserLocalStorageCache(options) {
|
|
|
26
26
|
function getNamespace() {
|
|
27
27
|
return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
|
|
28
28
|
}
|
|
29
|
+
function setNamespace(namespace) {
|
|
30
|
+
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
31
|
+
}
|
|
32
|
+
function removeOutdatedCacheItems() {
|
|
33
|
+
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
|
|
34
|
+
const namespace = getNamespace();
|
|
35
|
+
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
|
|
36
|
+
return cacheItem.timestamp !== undefined;
|
|
37
|
+
}));
|
|
38
|
+
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
|
|
39
|
+
if (!timeToLive) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
|
|
43
|
+
const currentTimestamp = new Date().getTime();
|
|
44
|
+
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
|
|
45
|
+
return !isExpired;
|
|
46
|
+
}));
|
|
47
|
+
setNamespace(filteredNamespaceWithoutExpiredItems);
|
|
48
|
+
}
|
|
29
49
|
return {
|
|
30
50
|
get(key, defaultValue, events = {
|
|
31
51
|
miss: () => Promise.resolve()
|
|
32
52
|
}) {
|
|
33
53
|
return Promise.resolve().then(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
removeOutdatedCacheItems();
|
|
55
|
+
return getNamespace()[JSON.stringify(key)];
|
|
56
|
+
}).then(value => {
|
|
57
|
+
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
|
|
37
58
|
}).then(([value, exists]) => {
|
|
38
59
|
return Promise.all([value, exists || events.miss(value)]);
|
|
39
60
|
}).then(([value]) => value);
|
|
@@ -41,7 +62,10 @@ function createBrowserLocalStorageCache(options) {
|
|
|
41
62
|
set(key, value) {
|
|
42
63
|
return Promise.resolve().then(() => {
|
|
43
64
|
const namespace = getNamespace();
|
|
44
|
-
namespace[JSON.stringify(key)] =
|
|
65
|
+
namespace[JSON.stringify(key)] = {
|
|
66
|
+
timestamp: new Date().getTime(),
|
|
67
|
+
value
|
|
68
|
+
};
|
|
45
69
|
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
46
70
|
return value;
|
|
47
71
|
});
|
|
@@ -171,33 +195,27 @@ function createStatefulHost(host, status = 'up') {
|
|
|
171
195
|
};
|
|
172
196
|
}
|
|
173
197
|
|
|
174
|
-
function _defineProperty(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
writable: true
|
|
182
|
-
});
|
|
183
|
-
} else {
|
|
184
|
-
obj[key] = value;
|
|
185
|
-
}
|
|
186
|
-
return obj;
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
187
205
|
}
|
|
188
|
-
function _toPrimitive(
|
|
189
|
-
if (
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
206
|
+
function _toPrimitive(t, r) {
|
|
207
|
+
if ("object" != typeof t || !t) return t;
|
|
208
|
+
var e = t[Symbol.toPrimitive];
|
|
209
|
+
if (void 0 !== e) {
|
|
210
|
+
var i = e.call(t, r || "default");
|
|
211
|
+
if ("object" != typeof i) return i;
|
|
194
212
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
195
213
|
}
|
|
196
|
-
return (
|
|
214
|
+
return ("string" === r ? String : Number)(t);
|
|
197
215
|
}
|
|
198
|
-
function _toPropertyKey(
|
|
199
|
-
var
|
|
200
|
-
return
|
|
216
|
+
function _toPropertyKey(t) {
|
|
217
|
+
var i = _toPrimitive(t, "string");
|
|
218
|
+
return "symbol" == typeof i ? i : i + "";
|
|
201
219
|
}
|
|
202
220
|
|
|
203
221
|
class AlgoliaError extends Error {
|
|
@@ -219,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
219
237
|
}
|
|
220
238
|
class RetryError extends ErrorWithStackTrace {
|
|
221
239
|
constructor(stackTrace) {
|
|
222
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
240
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
223
241
|
}
|
|
224
242
|
}
|
|
225
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -244,28 +262,16 @@ class DetailedApiError extends ApiError {
|
|
|
244
262
|
this.error = error;
|
|
245
263
|
}
|
|
246
264
|
}
|
|
247
|
-
|
|
248
|
-
function shuffle(array) {
|
|
249
|
-
const shuffledArray = array;
|
|
250
|
-
for (let c = array.length - 1; c > 0; c--) {
|
|
251
|
-
const b = Math.floor(Math.random() * (c + 1));
|
|
252
|
-
const a = array[c];
|
|
253
|
-
shuffledArray[c] = array[b];
|
|
254
|
-
shuffledArray[b] = a;
|
|
255
|
-
}
|
|
256
|
-
return shuffledArray;
|
|
257
|
-
}
|
|
258
265
|
function serializeUrl(host, path, queryParameters) {
|
|
259
266
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
260
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
267
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
261
268
|
if (queryParametersAsString.length) {
|
|
262
269
|
url += `?${queryParametersAsString}`;
|
|
263
270
|
}
|
|
264
271
|
return url;
|
|
265
272
|
}
|
|
266
273
|
function serializeQueryParameters(parameters) {
|
|
267
|
-
|
|
268
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
274
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
269
275
|
}
|
|
270
276
|
function serializeData(request, requestOptions) {
|
|
271
277
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -436,16 +442,13 @@ function createTransporter({
|
|
|
436
442
|
if (host === undefined) {
|
|
437
443
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
438
444
|
}
|
|
439
|
-
let responseTimeout = requestOptions.
|
|
440
|
-
if (responseTimeout === undefined) {
|
|
441
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
442
|
-
}
|
|
445
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
443
446
|
const payload = {
|
|
444
447
|
data,
|
|
445
448
|
headers,
|
|
446
449
|
method: request.method,
|
|
447
450
|
url: serializeUrl(host, request.path, queryParameters),
|
|
448
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
451
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
449
452
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
450
453
|
};
|
|
451
454
|
/**
|
|
@@ -673,42 +676,17 @@ function createXhrRequester() {
|
|
|
673
676
|
}
|
|
674
677
|
|
|
675
678
|
// 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.
|
|
676
|
-
const apiClientVersion = '1.0.0-
|
|
677
|
-
function getDefaultHosts(
|
|
679
|
+
const apiClientVersion = '1.0.0-beta.10';
|
|
680
|
+
function getDefaultHosts() {
|
|
678
681
|
return [
|
|
679
|
-
{
|
|
680
|
-
|
|
681
|
-
accept: 'read',
|
|
682
|
-
protocol: 'https',
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
url: `${appId}.algolia.net`,
|
|
686
|
-
accept: 'write',
|
|
687
|
-
protocol: 'https',
|
|
688
|
-
},
|
|
689
|
-
].concat(shuffle([
|
|
690
|
-
{
|
|
691
|
-
url: `${appId}-1.algolianet.com`,
|
|
692
|
-
accept: 'readWrite',
|
|
693
|
-
protocol: 'https',
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
url: `${appId}-2.algolianet.com`,
|
|
697
|
-
accept: 'readWrite',
|
|
698
|
-
protocol: 'https',
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
url: `${appId}-3.algolianet.com`,
|
|
702
|
-
accept: 'readWrite',
|
|
703
|
-
protocol: 'https',
|
|
704
|
-
},
|
|
705
|
-
]));
|
|
682
|
+
{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' },
|
|
683
|
+
];
|
|
706
684
|
}
|
|
707
685
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
708
686
|
function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
709
687
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
710
688
|
const transporter = createTransporter({
|
|
711
|
-
hosts: getDefaultHosts(
|
|
689
|
+
hosts: getDefaultHosts(),
|
|
712
690
|
...options,
|
|
713
691
|
algoliaAgent: getAlgoliaAgent({
|
|
714
692
|
algoliaAgents,
|
|
@@ -758,17 +736,16 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
758
736
|
/**
|
|
759
737
|
* This method allow you to send requests to the Algolia REST API.
|
|
760
738
|
*
|
|
761
|
-
* @
|
|
762
|
-
* @param
|
|
763
|
-
* @param
|
|
764
|
-
* @param del.parameters - Query parameters to apply to the current query.
|
|
739
|
+
* @param customDelete - The customDelete object.
|
|
740
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
741
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
765
742
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
766
743
|
*/
|
|
767
|
-
|
|
744
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
768
745
|
if (!path) {
|
|
769
|
-
throw new Error('Parameter `path` is required when calling `
|
|
746
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
770
747
|
}
|
|
771
|
-
const requestPath = '/
|
|
748
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
772
749
|
const headers = {};
|
|
773
750
|
const queryParameters = parameters ? parameters : {};
|
|
774
751
|
const request = {
|
|
@@ -782,17 +759,16 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
782
759
|
/**
|
|
783
760
|
* This method allow you to send requests to the Algolia REST API.
|
|
784
761
|
*
|
|
785
|
-
* @
|
|
786
|
-
* @param
|
|
787
|
-
* @param
|
|
788
|
-
* @param get.parameters - Query parameters to apply to the current query.
|
|
762
|
+
* @param customGet - The customGet object.
|
|
763
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
764
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
789
765
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
790
766
|
*/
|
|
791
|
-
|
|
767
|
+
customGet({ path, parameters }, requestOptions) {
|
|
792
768
|
if (!path) {
|
|
793
|
-
throw new Error('Parameter `path` is required when calling `
|
|
769
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
794
770
|
}
|
|
795
|
-
const requestPath = '/
|
|
771
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
796
772
|
const headers = {};
|
|
797
773
|
const queryParameters = parameters ? parameters : {};
|
|
798
774
|
const request = {
|
|
@@ -804,9 +780,58 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
804
780
|
return transporter.request(request, requestOptions);
|
|
805
781
|
},
|
|
806
782
|
/**
|
|
807
|
-
*
|
|
783
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
784
|
+
*
|
|
785
|
+
* @param customPost - The customPost object.
|
|
786
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
787
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
788
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
789
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
790
|
+
*/
|
|
791
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
792
|
+
if (!path) {
|
|
793
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
794
|
+
}
|
|
795
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
796
|
+
const headers = {};
|
|
797
|
+
const queryParameters = parameters ? parameters : {};
|
|
798
|
+
const request = {
|
|
799
|
+
method: 'POST',
|
|
800
|
+
path: requestPath,
|
|
801
|
+
queryParameters,
|
|
802
|
+
headers,
|
|
803
|
+
data: body ? body : {},
|
|
804
|
+
};
|
|
805
|
+
return transporter.request(request, requestOptions);
|
|
806
|
+
},
|
|
807
|
+
/**
|
|
808
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
809
|
+
*
|
|
810
|
+
* @param customPut - The customPut object.
|
|
811
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
812
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
813
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
814
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
815
|
+
*/
|
|
816
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
817
|
+
if (!path) {
|
|
818
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
819
|
+
}
|
|
820
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
821
|
+
const headers = {};
|
|
822
|
+
const queryParameters = parameters ? parameters : {};
|
|
823
|
+
const request = {
|
|
824
|
+
method: 'PUT',
|
|
825
|
+
path: requestPath,
|
|
826
|
+
queryParameters,
|
|
827
|
+
headers,
|
|
828
|
+
data: body ? body : {},
|
|
829
|
+
};
|
|
830
|
+
return transporter.request(request, requestOptions);
|
|
831
|
+
},
|
|
832
|
+
/**
|
|
833
|
+
* Retrieves known incidents for the selected clusters.
|
|
808
834
|
*
|
|
809
|
-
* @summary List incidents for selected clusters.
|
|
810
835
|
* @param getClusterIncidents - The getClusterIncidents object.
|
|
811
836
|
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
812
837
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -827,9 +852,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
827
852
|
return transporter.request(request, requestOptions);
|
|
828
853
|
},
|
|
829
854
|
/**
|
|
830
|
-
*
|
|
855
|
+
* Retrieves the status of selected clusters.
|
|
831
856
|
*
|
|
832
|
-
* @summary List statuses of selected clusters.
|
|
833
857
|
* @param getClusterStatus - The getClusterStatus object.
|
|
834
858
|
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
835
859
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -850,9 +874,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
850
874
|
return transporter.request(request, requestOptions);
|
|
851
875
|
},
|
|
852
876
|
/**
|
|
853
|
-
*
|
|
877
|
+
* Retrieves known incidents for all clusters.
|
|
854
878
|
*
|
|
855
|
-
* @summary List incidents.
|
|
856
879
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
857
880
|
*/
|
|
858
881
|
getIncidents(requestOptions) {
|
|
@@ -868,9 +891,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
868
891
|
return transporter.request(request, requestOptions);
|
|
869
892
|
},
|
|
870
893
|
/**
|
|
871
|
-
*
|
|
894
|
+
* Retrieves average times for indexing operations for selected clusters.
|
|
872
895
|
*
|
|
873
|
-
* @summary Get indexing times.
|
|
874
896
|
* @param getIndexingTime - The getIndexingTime object.
|
|
875
897
|
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
876
898
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -891,27 +913,8 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
891
913
|
return transporter.request(request, requestOptions);
|
|
892
914
|
},
|
|
893
915
|
/**
|
|
894
|
-
*
|
|
916
|
+
* Retrieves the average latency for search requests for selected clusters.
|
|
895
917
|
*
|
|
896
|
-
* @summary List servers.
|
|
897
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
898
|
-
*/
|
|
899
|
-
getInventory(requestOptions) {
|
|
900
|
-
const requestPath = '/1/inventory/servers';
|
|
901
|
-
const headers = {};
|
|
902
|
-
const queryParameters = {};
|
|
903
|
-
const request = {
|
|
904
|
-
method: 'GET',
|
|
905
|
-
path: requestPath,
|
|
906
|
-
queryParameters,
|
|
907
|
-
headers,
|
|
908
|
-
};
|
|
909
|
-
return transporter.request(request, requestOptions);
|
|
910
|
-
},
|
|
911
|
-
/**
|
|
912
|
-
* List the average latency for search requests for selected clusters.
|
|
913
|
-
*
|
|
914
|
-
* @summary Get search latency times.
|
|
915
918
|
* @param getLatency - The getLatency object.
|
|
916
919
|
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
917
920
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -932,11 +935,10 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
932
935
|
return transporter.request(request, requestOptions);
|
|
933
936
|
},
|
|
934
937
|
/**
|
|
935
|
-
*
|
|
938
|
+
* 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).
|
|
936
939
|
*
|
|
937
|
-
* @summary Get metrics for a given period.
|
|
938
940
|
* @param getMetrics - The getMetrics object.
|
|
939
|
-
* @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the response. To include all metrics, use
|
|
941
|
+
* @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 `*`.
|
|
940
942
|
* @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.
|
|
941
943
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
942
944
|
*/
|
|
@@ -963,7 +965,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
963
965
|
/**
|
|
964
966
|
* Test whether clusters are reachable or not.
|
|
965
967
|
*
|
|
966
|
-
* @summary Test the reachability of clusters.
|
|
967
968
|
* @param getReachability - The getReachability object.
|
|
968
969
|
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
969
970
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -984,13 +985,12 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
984
985
|
return transporter.request(request, requestOptions);
|
|
985
986
|
},
|
|
986
987
|
/**
|
|
987
|
-
*
|
|
988
|
+
* 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.
|
|
988
989
|
*
|
|
989
|
-
* @summary List cluster statuses.
|
|
990
990
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
991
991
|
*/
|
|
992
|
-
|
|
993
|
-
const requestPath = '/1/
|
|
992
|
+
getServers(requestOptions) {
|
|
993
|
+
const requestPath = '/1/inventory/servers';
|
|
994
994
|
const headers = {};
|
|
995
995
|
const queryParameters = {};
|
|
996
996
|
const request = {
|
|
@@ -1002,54 +1002,19 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
1002
1002
|
return transporter.request(request, requestOptions);
|
|
1003
1003
|
},
|
|
1004
1004
|
/**
|
|
1005
|
-
*
|
|
1006
|
-
*
|
|
1007
|
-
* @summary Send requests to the Algolia REST API.
|
|
1008
|
-
* @param post - The post object.
|
|
1009
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1010
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
1011
|
-
* @param post.body - Parameters to send with the custom request.
|
|
1012
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1013
|
-
*/
|
|
1014
|
-
post({ path, parameters, body }, requestOptions) {
|
|
1015
|
-
if (!path) {
|
|
1016
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
1017
|
-
}
|
|
1018
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1019
|
-
const headers = {};
|
|
1020
|
-
const queryParameters = parameters ? parameters : {};
|
|
1021
|
-
const request = {
|
|
1022
|
-
method: 'POST',
|
|
1023
|
-
path: requestPath,
|
|
1024
|
-
queryParameters,
|
|
1025
|
-
headers,
|
|
1026
|
-
data: body ? body : {},
|
|
1027
|
-
};
|
|
1028
|
-
return transporter.request(request, requestOptions);
|
|
1029
|
-
},
|
|
1030
|
-
/**
|
|
1031
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
1005
|
+
* Retrieves the status of all Algolia clusters and instances.
|
|
1032
1006
|
*
|
|
1033
|
-
* @summary Send requests to the Algolia REST API.
|
|
1034
|
-
* @param put - The put object.
|
|
1035
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1036
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
1037
|
-
* @param put.body - Parameters to send with the custom request.
|
|
1038
1007
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1039
1008
|
*/
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
1043
|
-
}
|
|
1044
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1009
|
+
getStatus(requestOptions) {
|
|
1010
|
+
const requestPath = '/1/status';
|
|
1045
1011
|
const headers = {};
|
|
1046
|
-
const queryParameters =
|
|
1012
|
+
const queryParameters = {};
|
|
1047
1013
|
const request = {
|
|
1048
|
-
method: '
|
|
1014
|
+
method: 'GET',
|
|
1049
1015
|
path: requestPath,
|
|
1050
1016
|
queryParameters,
|
|
1051
1017
|
headers,
|
|
1052
|
-
data: body ? body : {},
|
|
1053
1018
|
};
|
|
1054
1019
|
return transporter.request(request, requestOptions);
|
|
1055
1020
|
},
|
|
@@ -1057,6 +1022,7 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
1057
1022
|
}
|
|
1058
1023
|
|
|
1059
1024
|
// 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.
|
|
1025
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
1060
1026
|
function monitoringClient(appId, apiKey, options) {
|
|
1061
1027
|
if (!appId || typeof appId !== 'string') {
|
|
1062
1028
|
throw new Error('`appId` is missing.');
|