@3sixty/telemetry-rest-client 0.0.0-stage → 0.20.0-next.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.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/index.js +4 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/telemetryRestClient.js +181 -0
- package/dist/es/telemetryRestClient.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/telemetryRestClient.d.ts +116 -0
- package/docs/changelog.md +16 -0
- package/docs/examples.md +70 -0
- package/docs/reference/classes/TelemetryRestClient.md +359 -0
- package/docs/reference/index.md +5 -0
- package/locales/en.json +1 -0
- package/package.json +52 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 IOTA Stiftung.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 3Sixty Telemetry REST Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
REST client for interacting with telemetry service endpoints.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @3sixty/telemetry-rest-client
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
|
|
14
|
+
|
|
15
|
+
## Reference
|
|
16
|
+
|
|
17
|
+
Detailed reference documentation for the API can be found in [docs/reference/index.md](docs/reference/index.md)
|
|
18
|
+
|
|
19
|
+
## Changelog
|
|
20
|
+
|
|
21
|
+
The changes between each version can be found in [docs/changelog.md](docs/changelog.md)
|
|
22
|
+
|
|
23
|
+
## Origin
|
|
24
|
+
|
|
25
|
+
This package is derived from the original [iotaledger/twin-telemetry](https://github.com/iotaledger/twin-telemetry/tree/next/packages/telemetry-rest-client) repository.
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,0BAA0B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./telemetryRestClient.js\";\n"]}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { BaseRestClient } from "@3sixty/api-core";
|
|
4
|
+
import { HttpHeaderHelper } from "@3sixty/api-models";
|
|
5
|
+
import { Coerce, Guards } from "@3sixty/core";
|
|
6
|
+
import { HttpMethod } from "@3sixty/web";
|
|
7
|
+
/**
|
|
8
|
+
* Client for performing telemetry through to REST endpoints.
|
|
9
|
+
*/
|
|
10
|
+
export class TelemetryRestClient extends BaseRestClient {
|
|
11
|
+
/**
|
|
12
|
+
* Runtime name for the class.
|
|
13
|
+
*/
|
|
14
|
+
static CLASS_NAME = "TelemetryRestClient";
|
|
15
|
+
/**
|
|
16
|
+
* Create a new instance of TelemetryRestClient.
|
|
17
|
+
* @param config The configuration for the client.
|
|
18
|
+
*/
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super(TelemetryRestClient.CLASS_NAME, config, "telemetry");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the class name of the component.
|
|
24
|
+
* @returns The class name of the component.
|
|
25
|
+
*/
|
|
26
|
+
className() {
|
|
27
|
+
return TelemetryRestClient.CLASS_NAME;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create one or more metrics.
|
|
31
|
+
* @param metric The metric details, or the details of several metrics.
|
|
32
|
+
* @returns A promise that resolves when the metrics have been created.
|
|
33
|
+
*/
|
|
34
|
+
async createMetric(metric) {
|
|
35
|
+
Guards.defined(TelemetryRestClient.CLASS_NAME, "metric", metric);
|
|
36
|
+
await this.fetch("/metric", HttpMethod.POST, {
|
|
37
|
+
body: metric
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get the metric details and it's most recent value.
|
|
42
|
+
* @param id The metric id.
|
|
43
|
+
* @returns The metric details and it's most recent value.
|
|
44
|
+
*/
|
|
45
|
+
async getMetric(id) {
|
|
46
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "id", id);
|
|
47
|
+
const response = await this.fetch("/metric/:id", HttpMethod.GET, {
|
|
48
|
+
pathParams: {
|
|
49
|
+
id
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return response.body;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get a specific metric value by its id.
|
|
56
|
+
* @param id The id of the metric.
|
|
57
|
+
* @param valueId The id of the metric value.
|
|
58
|
+
* @returns The metric value.
|
|
59
|
+
*/
|
|
60
|
+
async getMetricValue(id, valueId) {
|
|
61
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "id", id);
|
|
62
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "valueId", valueId);
|
|
63
|
+
const response = await this.fetch("/metric/:id/value/:valueId", HttpMethod.GET, {
|
|
64
|
+
pathParams: { id, valueId }
|
|
65
|
+
});
|
|
66
|
+
return response.body;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Update metric.
|
|
70
|
+
* @param metric The metric details.
|
|
71
|
+
* @returns A promise that resolves when the metric has been updated.
|
|
72
|
+
*/
|
|
73
|
+
async updateMetric(metric) {
|
|
74
|
+
Guards.object(TelemetryRestClient.CLASS_NAME, "metric", metric);
|
|
75
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "metric.id", metric.id);
|
|
76
|
+
await this.fetch("/metric/:id", HttpMethod.PUT, {
|
|
77
|
+
pathParams: {
|
|
78
|
+
id: metric.id
|
|
79
|
+
},
|
|
80
|
+
body: {
|
|
81
|
+
label: metric.label,
|
|
82
|
+
description: metric.description,
|
|
83
|
+
unit: metric.unit
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Add a metric value.
|
|
89
|
+
* @param id The id of the metric.
|
|
90
|
+
* @param value The value for the add operation.
|
|
91
|
+
* @param customData The custom data for the add operation.
|
|
92
|
+
* @returns The created metric value id.
|
|
93
|
+
*/
|
|
94
|
+
async addMetricValue(id, value, customData) {
|
|
95
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "id", id);
|
|
96
|
+
Guards.defined(TelemetryRestClient.CLASS_NAME, "value", value);
|
|
97
|
+
const response = await this.fetch("/metric/:id/value", HttpMethod.POST, {
|
|
98
|
+
pathParams: {
|
|
99
|
+
id
|
|
100
|
+
},
|
|
101
|
+
body: {
|
|
102
|
+
value,
|
|
103
|
+
customData
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return HttpHeaderHelper.extractId(response.headers, `${this.getPathPrefix()}/metric/:metricId/value/:id`);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Add multiple metric values.
|
|
110
|
+
* @param values The metric values to add.
|
|
111
|
+
* @returns The created metric value ids, in the order the values were supplied.
|
|
112
|
+
*/
|
|
113
|
+
async addMetricValues(values) {
|
|
114
|
+
Guards.array(TelemetryRestClient.CLASS_NAME, "values", values);
|
|
115
|
+
// The REST surface records one value per request, so each value becomes a request.
|
|
116
|
+
const valueIds = [];
|
|
117
|
+
for (const entry of values) {
|
|
118
|
+
valueIds.push(await this.addMetricValue(entry.id, entry.value, entry.customData));
|
|
119
|
+
}
|
|
120
|
+
return valueIds;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Remove metric.
|
|
124
|
+
* @param id The id of the metric.
|
|
125
|
+
* @returns A promise that resolves when the metric and all its values have been removed.
|
|
126
|
+
*/
|
|
127
|
+
async removeMetric(id) {
|
|
128
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "id", id);
|
|
129
|
+
await this.fetch("/metric/:id", HttpMethod.DELETE, {
|
|
130
|
+
pathParams: {
|
|
131
|
+
id
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Query the metrics.
|
|
137
|
+
* @param type The type of the metric.
|
|
138
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
139
|
+
* @param limit Limit the number of entities to return.
|
|
140
|
+
* @returns All the entities for the storage matching the conditions,
|
|
141
|
+
* and a cursor which can be used to request more entities.
|
|
142
|
+
* @throws NotImplementedError if the implementation does not support retrieval.
|
|
143
|
+
*/
|
|
144
|
+
async query(type, cursor, limit) {
|
|
145
|
+
const result = await this.fetch("/metric", HttpMethod.GET, {
|
|
146
|
+
query: {
|
|
147
|
+
type: Coerce.string(type),
|
|
148
|
+
cursor,
|
|
149
|
+
limit: Coerce.string(limit)
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return result.body;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Query the metric values.
|
|
156
|
+
* @param id The id of the metric.
|
|
157
|
+
* @param timeStart The inclusive time as the start of the metric entries.
|
|
158
|
+
* @param timeEnd The inclusive time as the end of the metric entries.
|
|
159
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
160
|
+
* @param limit Limit the number of entities to return.
|
|
161
|
+
* @returns All the entities for the storage matching the conditions,
|
|
162
|
+
* and a cursor which can be used to request more entities.
|
|
163
|
+
* @throws NotImplementedError if the implementation does not support retrieval.
|
|
164
|
+
*/
|
|
165
|
+
async queryValues(id, timeStart, timeEnd, cursor, limit) {
|
|
166
|
+
Guards.stringValue(TelemetryRestClient.CLASS_NAME, "id", id);
|
|
167
|
+
const result = await this.fetch("/metric/:id/value", HttpMethod.GET, {
|
|
168
|
+
pathParams: {
|
|
169
|
+
id
|
|
170
|
+
},
|
|
171
|
+
query: {
|
|
172
|
+
timeStart: Coerce.string(timeStart),
|
|
173
|
+
timeEnd: Coerce.string(timeEnd),
|
|
174
|
+
cursor,
|
|
175
|
+
limit: Coerce.string(limit)
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return result.body;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=telemetryRestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetryRestClient.js","sources":["../../src/telemetryRestClient.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@3sixty/api-core\";\nimport {\n\tHttpHeaderHelper,\n\ttype IBaseRestClientConfig,\n\ttype ICreatedResponse,\n\ttype INoContentResponse\n} from \"@3sixty/api-models\";\nimport { Coerce, Guards } from \"@3sixty/core\";\n\nimport type {\n\tITelemetryAddMetricValueRequest,\n\tITelemetryComponent,\n\tITelemetryCreateMetricRequest,\n\tITelemetryGetMetricRequest,\n\tITelemetryGetMetricResponse,\n\tITelemetryGetMetricValueRequest,\n\tITelemetryGetMetricValueResponse,\n\tITelemetryListRequest,\n\tITelemetryMetricValueEntry,\n\tITelemetryListResponse,\n\tITelemetryMetric,\n\tITelemetryMetricValue,\n\tITelemetryRemoveMetricRequest,\n\tITelemetryUpdateMetricRequest,\n\tITelemetryValuesListRequest,\n\tITelemetryValuesListResponse,\n\tMetricCounterOperation,\n\tMetricType\n} from \"@3sixty/telemetry-models\";\nimport { HttpMethod } from \"@3sixty/web\";\n\n/**\n * Client for performing telemetry through to REST endpoints.\n */\nexport class TelemetryRestClient extends BaseRestClient implements ITelemetryComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"TelemetryRestClient\";\n\n\t/**\n\t * Create a new instance of TelemetryRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(TelemetryRestClient.CLASS_NAME, config, \"telemetry\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn TelemetryRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create one or more metrics.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tpublic async createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void> {\n\t\tGuards.defined(TelemetryRestClient.CLASS_NAME, \"metric\", metric);\n\n\t\tawait this.fetch<ITelemetryCreateMetricRequest, ICreatedResponse>(\"/metric\", HttpMethod.POST, {\n\t\t\tbody: metric\n\t\t});\n\t}\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tpublic async getMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}> {\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"id\", id);\n\n\t\tconst response = await this.fetch<ITelemetryGetMetricRequest, ITelemetryGetMetricResponse>(\n\t\t\t\"/metric/:id\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tpublic async getMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue> {\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"id\", id);\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"valueId\", valueId);\n\n\t\tconst response = await this.fetch<\n\t\t\tITelemetryGetMetricValueRequest,\n\t\t\tITelemetryGetMetricValueResponse\n\t\t>(\"/metric/:id/value/:valueId\", HttpMethod.GET, {\n\t\t\tpathParams: { id, valueId }\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tpublic async updateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void> {\n\t\tGuards.object<ITelemetryMetric>(TelemetryRestClient.CLASS_NAME, \"metric\", metric);\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"metric.id\", metric.id);\n\n\t\tawait this.fetch<ITelemetryUpdateMetricRequest, INoContentResponse>(\n\t\t\t\"/metric/:id\",\n\t\t\tHttpMethod.PUT,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid: metric.id\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tlabel: metric.label,\n\t\t\t\t\tdescription: metric.description,\n\t\t\t\t\tunit: metric.unit\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\tpublic async addMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string> {\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"id\", id);\n\t\tGuards.defined(TelemetryRestClient.CLASS_NAME, \"value\", value);\n\n\t\tconst response = await this.fetch<ITelemetryAddMetricValueRequest, ICreatedResponse>(\n\t\t\t\"/metric/:id/value\",\n\t\t\tHttpMethod.POST,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tvalue,\n\t\t\t\t\tcustomData\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn HttpHeaderHelper.extractId(\n\t\t\tresponse.headers,\n\t\t\t`${this.getPathPrefix()}/metric/:metricId/value/:id`\n\t\t);\n\t}\n\n\t/**\n\t * Add multiple metric values.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\tpublic async addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]> {\n\t\tGuards.array<ITelemetryMetricValueEntry>(\n\t\t\tTelemetryRestClient.CLASS_NAME,\n\t\t\t\"values\",\n\t\t\tvalues\n\t\t);\n\n\t\t// The REST surface records one value per request, so each value becomes a request.\n\t\tconst valueIds: string[] = [];\n\t\tfor (const entry of values) {\n\t\t\tvalueIds.push(await this.addMetricValue(entry.id, entry.value, entry.customData));\n\t\t}\n\t\treturn valueIds;\n\t}\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tpublic async removeMetric(id: string): Promise<void> {\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"id\", id);\n\n\t\tawait this.fetch<ITelemetryRemoveMetricRequest, INoContentResponse>(\n\t\t\t\"/metric/:id\",\n\t\t\tHttpMethod.DELETE,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async query(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst result = await this.fetch<ITelemetryListRequest, ITelemetryListResponse>(\n\t\t\t\"/metric\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\ttype: Coerce.string(type),\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn result.body;\n\t}\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async queryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(TelemetryRestClient.CLASS_NAME, \"id\", id);\n\n\t\tconst result = await this.fetch<ITelemetryValuesListRequest, ITelemetryValuesListResponse>(\n\t\t\t\"/metric/:id/value\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t},\n\t\t\t\tquery: {\n\t\t\t\t\ttimeStart: Coerce.string(timeStart),\n\t\t\t\t\ttimeEnd: Coerce.string(timeEnd),\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn result.body;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./telemetryRestClient.js";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { BaseRestClient } from "@3sixty/api-core";
|
|
2
|
+
import { type IBaseRestClientConfig } from "@3sixty/api-models";
|
|
3
|
+
import type { ITelemetryComponent, ITelemetryMetricValueEntry, ITelemetryMetric, ITelemetryMetricValue, MetricCounterOperation, MetricType } from "@3sixty/telemetry-models";
|
|
4
|
+
/**
|
|
5
|
+
* Client for performing telemetry through to REST endpoints.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TelemetryRestClient extends BaseRestClient implements ITelemetryComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of TelemetryRestClient.
|
|
14
|
+
* @param config The configuration for the client.
|
|
15
|
+
*/
|
|
16
|
+
constructor(config: IBaseRestClientConfig);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Create one or more metrics.
|
|
24
|
+
* @param metric The metric details, or the details of several metrics.
|
|
25
|
+
* @returns A promise that resolves when the metrics have been created.
|
|
26
|
+
*/
|
|
27
|
+
createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Get the metric details and it's most recent value.
|
|
30
|
+
* @param id The metric id.
|
|
31
|
+
* @returns The metric details and it's most recent value.
|
|
32
|
+
*/
|
|
33
|
+
getMetric(id: string): Promise<{
|
|
34
|
+
metric: ITelemetryMetric;
|
|
35
|
+
value?: ITelemetryMetricValue;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a specific metric value by its id.
|
|
39
|
+
* @param id The id of the metric.
|
|
40
|
+
* @param valueId The id of the metric value.
|
|
41
|
+
* @returns The metric value.
|
|
42
|
+
*/
|
|
43
|
+
getMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue>;
|
|
44
|
+
/**
|
|
45
|
+
* Update metric.
|
|
46
|
+
* @param metric The metric details.
|
|
47
|
+
* @returns A promise that resolves when the metric has been updated.
|
|
48
|
+
*/
|
|
49
|
+
updateMetric(metric: Omit<ITelemetryMetric, "type">): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Add a metric value.
|
|
52
|
+
* @param id The id of the metric.
|
|
53
|
+
* @param value The value for the add operation.
|
|
54
|
+
* @param customData The custom data for the add operation.
|
|
55
|
+
* @returns The created metric value id.
|
|
56
|
+
*/
|
|
57
|
+
addMetricValue(id: string, value: MetricCounterOperation | number, customData?: {
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}): Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Add multiple metric values.
|
|
62
|
+
* @param values The metric values to add.
|
|
63
|
+
* @returns The created metric value ids, in the order the values were supplied.
|
|
64
|
+
*/
|
|
65
|
+
addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Remove metric.
|
|
68
|
+
* @param id The id of the metric.
|
|
69
|
+
* @returns A promise that resolves when the metric and all its values have been removed.
|
|
70
|
+
*/
|
|
71
|
+
removeMetric(id: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Query the metrics.
|
|
74
|
+
* @param type The type of the metric.
|
|
75
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
76
|
+
* @param limit Limit the number of entities to return.
|
|
77
|
+
* @returns All the entities for the storage matching the conditions,
|
|
78
|
+
* and a cursor which can be used to request more entities.
|
|
79
|
+
* @throws NotImplementedError if the implementation does not support retrieval.
|
|
80
|
+
*/
|
|
81
|
+
query(type?: MetricType, cursor?: string, limit?: number): Promise<{
|
|
82
|
+
/**
|
|
83
|
+
* The metrics.
|
|
84
|
+
*/
|
|
85
|
+
entities: ITelemetryMetric[];
|
|
86
|
+
/**
|
|
87
|
+
* An optional cursor, when defined can be used to call find to get more values.
|
|
88
|
+
*/
|
|
89
|
+
cursor?: string;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Query the metric values.
|
|
93
|
+
* @param id The id of the metric.
|
|
94
|
+
* @param timeStart The inclusive time as the start of the metric entries.
|
|
95
|
+
* @param timeEnd The inclusive time as the end of the metric entries.
|
|
96
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
97
|
+
* @param limit Limit the number of entities to return.
|
|
98
|
+
* @returns All the entities for the storage matching the conditions,
|
|
99
|
+
* and a cursor which can be used to request more entities.
|
|
100
|
+
* @throws NotImplementedError if the implementation does not support retrieval.
|
|
101
|
+
*/
|
|
102
|
+
queryValues(id: string, timeStart?: number, timeEnd?: number, cursor?: string, limit?: number): Promise<{
|
|
103
|
+
/**
|
|
104
|
+
* The metric details.
|
|
105
|
+
*/
|
|
106
|
+
metric: ITelemetryMetric;
|
|
107
|
+
/**
|
|
108
|
+
* The values for the metric.
|
|
109
|
+
*/
|
|
110
|
+
entities: ITelemetryMetricValue[];
|
|
111
|
+
/**
|
|
112
|
+
* An optional cursor, when defined can be used to call find to get more values.
|
|
113
|
+
*/
|
|
114
|
+
cursor?: string;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/telemetry/compare/telemetry-rest-client-v0.20.0-next.0...telemetry-rest-client-v0.20.0-next.1) (2026-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([e488a8c](https://github.com/3sixtyglobal/telemetry/commit/e488a8cbe26251de694077a0164af480cab61c3a))
|
|
9
|
+
* updated ts compile ([4490a7b](https://github.com/3sixtyglobal/telemetry/commit/4490a7b854bdea72a79946d2dbb708a47e81b56f))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @3sixty/telemetry-models bumped from 0.20.0-next.0 to 0.20.0-next.1
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Telemetry Rest Client Examples
|
|
2
|
+
|
|
3
|
+
These snippets show how to call telemetry endpoints from application code and process the returned metric data.
|
|
4
|
+
|
|
5
|
+
## TelemetryRestClient
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { MetricType } from '@3sixty/telemetry-models';
|
|
9
|
+
import { TelemetryRestClient } from '@3sixty/telemetry-rest-client';
|
|
10
|
+
|
|
11
|
+
const client = new TelemetryRestClient({
|
|
12
|
+
endpoint: 'http://localhost:8080'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(client.className()); // telemetryRestClient
|
|
16
|
+
|
|
17
|
+
await client.createMetric({
|
|
18
|
+
id: 'cpu-usage',
|
|
19
|
+
label: 'CPU Usage',
|
|
20
|
+
description: 'Current process CPU usage',
|
|
21
|
+
unit: 'percent',
|
|
22
|
+
type: MetricType.Gauge
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const addedValueId = await client.addMetricValue('cpu-usage', 42.3, {
|
|
26
|
+
process: 'worker-a'
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(addedValueId.length > 0); // true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { MetricType } from '@3sixty/telemetry-models';
|
|
34
|
+
import { TelemetryRestClient } from '@3sixty/telemetry-rest-client';
|
|
35
|
+
|
|
36
|
+
const client = new TelemetryRestClient({ endpoint: 'http://localhost:8080' });
|
|
37
|
+
|
|
38
|
+
await client.updateMetric({
|
|
39
|
+
id: 'cpu-usage',
|
|
40
|
+
label: 'CPU Utilisation',
|
|
41
|
+
description: 'Current CPU utilisation',
|
|
42
|
+
unit: '%'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const latestMetric = await client.getMetric('cpu-usage');
|
|
46
|
+
console.log(latestMetric.metric.label); // CPU Utilisation
|
|
47
|
+
|
|
48
|
+
const metrics = await client.query(MetricType.Gauge, undefined, 20);
|
|
49
|
+
console.log(metrics.entities.length); // 1
|
|
50
|
+
|
|
51
|
+
const values = await client.queryValues(
|
|
52
|
+
'cpu-usage',
|
|
53
|
+
Date.now() - 900_000,
|
|
54
|
+
Date.now(),
|
|
55
|
+
undefined,
|
|
56
|
+
10
|
|
57
|
+
);
|
|
58
|
+
console.log(values.entities.length); // 1
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { TelemetryRestClient } from '@3sixty/telemetry-rest-client';
|
|
63
|
+
|
|
64
|
+
const client = new TelemetryRestClient({ endpoint: 'http://localhost:8080' });
|
|
65
|
+
|
|
66
|
+
await client.removeMetric('cpu-usage');
|
|
67
|
+
|
|
68
|
+
const remaining = await client.query(undefined, undefined, 20);
|
|
69
|
+
console.log(remaining.entities.length); // 0
|
|
70
|
+
```
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Class: TelemetryRestClient
|
|
2
|
+
|
|
3
|
+
Client for performing telemetry through to REST endpoints.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `BaseRestClient`
|
|
8
|
+
|
|
9
|
+
## Implements
|
|
10
|
+
|
|
11
|
+
- `ITelemetryComponent`
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new TelemetryRestClient**(`config`): `TelemetryRestClient`
|
|
18
|
+
|
|
19
|
+
Create a new instance of TelemetryRestClient.
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
26
|
+
|
|
27
|
+
The configuration for the client.
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`TelemetryRestClient`
|
|
32
|
+
|
|
33
|
+
#### Overrides
|
|
34
|
+
|
|
35
|
+
`BaseRestClient.constructor`
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
|
+
|
|
43
|
+
Runtime name for the class.
|
|
44
|
+
|
|
45
|
+
## Methods
|
|
46
|
+
|
|
47
|
+
### className() {#classname}
|
|
48
|
+
|
|
49
|
+
> **className**(): `string`
|
|
50
|
+
|
|
51
|
+
Returns the class name of the component.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The class name of the component.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
`ITelemetryComponent.className`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### createMetric() {#createmetric}
|
|
66
|
+
|
|
67
|
+
> **createMetric**(`metric`): `Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
Create one or more metrics.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### metric
|
|
74
|
+
|
|
75
|
+
`ITelemetryMetric` \| `ITelemetryMetric`[]
|
|
76
|
+
|
|
77
|
+
The metric details, or the details of several metrics.
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Promise`\<`void`\>
|
|
82
|
+
|
|
83
|
+
A promise that resolves when the metrics have been created.
|
|
84
|
+
|
|
85
|
+
#### Implementation of
|
|
86
|
+
|
|
87
|
+
`ITelemetryComponent.createMetric`
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### getMetric() {#getmetric}
|
|
92
|
+
|
|
93
|
+
> **getMetric**(`id`): `Promise`\<\{ `metric`: `ITelemetryMetric`; `value?`: `ITelemetryMetricValue`; \}\>
|
|
94
|
+
|
|
95
|
+
Get the metric details and it's most recent value.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
##### id
|
|
100
|
+
|
|
101
|
+
`string`
|
|
102
|
+
|
|
103
|
+
The metric id.
|
|
104
|
+
|
|
105
|
+
#### Returns
|
|
106
|
+
|
|
107
|
+
`Promise`\<\{ `metric`: `ITelemetryMetric`; `value?`: `ITelemetryMetricValue`; \}\>
|
|
108
|
+
|
|
109
|
+
The metric details and it's most recent value.
|
|
110
|
+
|
|
111
|
+
#### Implementation of
|
|
112
|
+
|
|
113
|
+
`ITelemetryComponent.getMetric`
|
|
114
|
+
|
|
115
|
+
***
|
|
116
|
+
|
|
117
|
+
### getMetricValue() {#getmetricvalue}
|
|
118
|
+
|
|
119
|
+
> **getMetricValue**(`id`, `valueId`): `Promise`\<`ITelemetryMetricValue`\>
|
|
120
|
+
|
|
121
|
+
Get a specific metric value by its id.
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
124
|
+
|
|
125
|
+
##### id
|
|
126
|
+
|
|
127
|
+
`string`
|
|
128
|
+
|
|
129
|
+
The id of the metric.
|
|
130
|
+
|
|
131
|
+
##### valueId
|
|
132
|
+
|
|
133
|
+
`string`
|
|
134
|
+
|
|
135
|
+
The id of the metric value.
|
|
136
|
+
|
|
137
|
+
#### Returns
|
|
138
|
+
|
|
139
|
+
`Promise`\<`ITelemetryMetricValue`\>
|
|
140
|
+
|
|
141
|
+
The metric value.
|
|
142
|
+
|
|
143
|
+
#### Implementation of
|
|
144
|
+
|
|
145
|
+
`ITelemetryComponent.getMetricValue`
|
|
146
|
+
|
|
147
|
+
***
|
|
148
|
+
|
|
149
|
+
### updateMetric() {#updatemetric}
|
|
150
|
+
|
|
151
|
+
> **updateMetric**(`metric`): `Promise`\<`void`\>
|
|
152
|
+
|
|
153
|
+
Update metric.
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
##### metric
|
|
158
|
+
|
|
159
|
+
`Omit`\<`ITelemetryMetric`, `"type"`\>
|
|
160
|
+
|
|
161
|
+
The metric details.
|
|
162
|
+
|
|
163
|
+
#### Returns
|
|
164
|
+
|
|
165
|
+
`Promise`\<`void`\>
|
|
166
|
+
|
|
167
|
+
A promise that resolves when the metric has been updated.
|
|
168
|
+
|
|
169
|
+
#### Implementation of
|
|
170
|
+
|
|
171
|
+
`ITelemetryComponent.updateMetric`
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### addMetricValue() {#addmetricvalue}
|
|
176
|
+
|
|
177
|
+
> **addMetricValue**(`id`, `value`, `customData?`): `Promise`\<`string`\>
|
|
178
|
+
|
|
179
|
+
Add a metric value.
|
|
180
|
+
|
|
181
|
+
#### Parameters
|
|
182
|
+
|
|
183
|
+
##### id
|
|
184
|
+
|
|
185
|
+
`string`
|
|
186
|
+
|
|
187
|
+
The id of the metric.
|
|
188
|
+
|
|
189
|
+
##### value
|
|
190
|
+
|
|
191
|
+
`number` \| `MetricCounterOperation`
|
|
192
|
+
|
|
193
|
+
The value for the add operation.
|
|
194
|
+
|
|
195
|
+
##### customData?
|
|
196
|
+
|
|
197
|
+
\{\[`key`: `string`\]: `unknown`; \}
|
|
198
|
+
|
|
199
|
+
The custom data for the add operation.
|
|
200
|
+
|
|
201
|
+
#### Returns
|
|
202
|
+
|
|
203
|
+
`Promise`\<`string`\>
|
|
204
|
+
|
|
205
|
+
The created metric value id.
|
|
206
|
+
|
|
207
|
+
#### Implementation of
|
|
208
|
+
|
|
209
|
+
`ITelemetryComponent.addMetricValue`
|
|
210
|
+
|
|
211
|
+
***
|
|
212
|
+
|
|
213
|
+
### addMetricValues() {#addmetricvalues}
|
|
214
|
+
|
|
215
|
+
> **addMetricValues**(`values`): `Promise`\<`string`[]\>
|
|
216
|
+
|
|
217
|
+
Add multiple metric values.
|
|
218
|
+
|
|
219
|
+
#### Parameters
|
|
220
|
+
|
|
221
|
+
##### values
|
|
222
|
+
|
|
223
|
+
`ITelemetryMetricValueEntry`[]
|
|
224
|
+
|
|
225
|
+
The metric values to add.
|
|
226
|
+
|
|
227
|
+
#### Returns
|
|
228
|
+
|
|
229
|
+
`Promise`\<`string`[]\>
|
|
230
|
+
|
|
231
|
+
The created metric value ids, in the order the values were supplied.
|
|
232
|
+
|
|
233
|
+
#### Implementation of
|
|
234
|
+
|
|
235
|
+
`ITelemetryComponent.addMetricValues`
|
|
236
|
+
|
|
237
|
+
***
|
|
238
|
+
|
|
239
|
+
### removeMetric() {#removemetric}
|
|
240
|
+
|
|
241
|
+
> **removeMetric**(`id`): `Promise`\<`void`\>
|
|
242
|
+
|
|
243
|
+
Remove metric.
|
|
244
|
+
|
|
245
|
+
#### Parameters
|
|
246
|
+
|
|
247
|
+
##### id
|
|
248
|
+
|
|
249
|
+
`string`
|
|
250
|
+
|
|
251
|
+
The id of the metric.
|
|
252
|
+
|
|
253
|
+
#### Returns
|
|
254
|
+
|
|
255
|
+
`Promise`\<`void`\>
|
|
256
|
+
|
|
257
|
+
A promise that resolves when the metric and all its values have been removed.
|
|
258
|
+
|
|
259
|
+
#### Implementation of
|
|
260
|
+
|
|
261
|
+
`ITelemetryComponent.removeMetric`
|
|
262
|
+
|
|
263
|
+
***
|
|
264
|
+
|
|
265
|
+
### query() {#query}
|
|
266
|
+
|
|
267
|
+
> **query**(`type?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `ITelemetryMetric`[]; `cursor?`: `string`; \}\>
|
|
268
|
+
|
|
269
|
+
Query the metrics.
|
|
270
|
+
|
|
271
|
+
#### Parameters
|
|
272
|
+
|
|
273
|
+
##### type?
|
|
274
|
+
|
|
275
|
+
`MetricType`
|
|
276
|
+
|
|
277
|
+
The type of the metric.
|
|
278
|
+
|
|
279
|
+
##### cursor?
|
|
280
|
+
|
|
281
|
+
`string`
|
|
282
|
+
|
|
283
|
+
The cursor to request the next chunk of entities.
|
|
284
|
+
|
|
285
|
+
##### limit?
|
|
286
|
+
|
|
287
|
+
`number`
|
|
288
|
+
|
|
289
|
+
Limit the number of entities to return.
|
|
290
|
+
|
|
291
|
+
#### Returns
|
|
292
|
+
|
|
293
|
+
`Promise`\<\{ `entities`: `ITelemetryMetric`[]; `cursor?`: `string`; \}\>
|
|
294
|
+
|
|
295
|
+
All the entities for the storage matching the conditions,
|
|
296
|
+
and a cursor which can be used to request more entities.
|
|
297
|
+
|
|
298
|
+
#### Throws
|
|
299
|
+
|
|
300
|
+
NotImplementedError if the implementation does not support retrieval.
|
|
301
|
+
|
|
302
|
+
#### Implementation of
|
|
303
|
+
|
|
304
|
+
`ITelemetryComponent.query`
|
|
305
|
+
|
|
306
|
+
***
|
|
307
|
+
|
|
308
|
+
### queryValues() {#queryvalues}
|
|
309
|
+
|
|
310
|
+
> **queryValues**(`id`, `timeStart?`, `timeEnd?`, `cursor?`, `limit?`): `Promise`\<\{ `metric`: `ITelemetryMetric`; `entities`: `ITelemetryMetricValue`[]; `cursor?`: `string`; \}\>
|
|
311
|
+
|
|
312
|
+
Query the metric values.
|
|
313
|
+
|
|
314
|
+
#### Parameters
|
|
315
|
+
|
|
316
|
+
##### id
|
|
317
|
+
|
|
318
|
+
`string`
|
|
319
|
+
|
|
320
|
+
The id of the metric.
|
|
321
|
+
|
|
322
|
+
##### timeStart?
|
|
323
|
+
|
|
324
|
+
`number`
|
|
325
|
+
|
|
326
|
+
The inclusive time as the start of the metric entries.
|
|
327
|
+
|
|
328
|
+
##### timeEnd?
|
|
329
|
+
|
|
330
|
+
`number`
|
|
331
|
+
|
|
332
|
+
The inclusive time as the end of the metric entries.
|
|
333
|
+
|
|
334
|
+
##### cursor?
|
|
335
|
+
|
|
336
|
+
`string`
|
|
337
|
+
|
|
338
|
+
The cursor to request the next chunk of entities.
|
|
339
|
+
|
|
340
|
+
##### limit?
|
|
341
|
+
|
|
342
|
+
`number`
|
|
343
|
+
|
|
344
|
+
Limit the number of entities to return.
|
|
345
|
+
|
|
346
|
+
#### Returns
|
|
347
|
+
|
|
348
|
+
`Promise`\<\{ `metric`: `ITelemetryMetric`; `entities`: `ITelemetryMetricValue`[]; `cursor?`: `string`; \}\>
|
|
349
|
+
|
|
350
|
+
All the entities for the storage matching the conditions,
|
|
351
|
+
and a cursor which can be used to request more entities.
|
|
352
|
+
|
|
353
|
+
#### Throws
|
|
354
|
+
|
|
355
|
+
NotImplementedError if the implementation does not support retrieval.
|
|
356
|
+
|
|
357
|
+
#### Implementation of
|
|
358
|
+
|
|
359
|
+
`ITelemetryComponent.queryValues`
|
package/locales/en.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@3sixty/telemetry-rest-client",
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
|
+
"description": "REST client for interacting with telemetry service endpoints.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/telemetry.git",
|
|
8
|
+
"directory": "packages/telemetry-rest-client"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@3sixty/api-core": "next",
|
|
18
|
+
"@3sixty/api-models": "next",
|
|
19
|
+
"@3sixty/core": "next",
|
|
20
|
+
"@3sixty/entity": "next",
|
|
21
|
+
"@3sixty/nameof": "next",
|
|
22
|
+
"@3sixty/telemetry-models": "0.20.0-next.1",
|
|
23
|
+
"@3sixty/web": "next"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/es/index.js",
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"import": "./dist/es/index.js",
|
|
31
|
+
"default": "./dist/es/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./locales/*.json": "./locales/*.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/es",
|
|
37
|
+
"dist/types",
|
|
38
|
+
"locales",
|
|
39
|
+
"docs"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"telemetry"
|
|
48
|
+
],
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "git+https://github.com/3sixtyglobal/telemetry/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://3sixty.global"
|
|
53
|
+
}
|