@twin.org/telemetry-service 0.0.3-next.1 → 0.0.3-next.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.
@@ -56,15 +56,8 @@
56
56
  }
57
57
  },
58
58
  "responses": {
59
- "200": {
59
+ "201": {
60
60
  "description": "The rest request ended in created response.",
61
- "content": {
62
- "text/plain": {
63
- "schema": {
64
- "$ref": "#/components/schemas/CreatedResponse"
65
- }
66
- }
67
- },
68
61
  "headers": {
69
62
  "location": {
70
63
  "schema": {
@@ -73,6 +66,63 @@
73
66
  "description": "e.g. my-counter"
74
67
  }
75
68
  }
69
+ },
70
+ "400": {
71
+ "description": "The server cannot process the request, see the content for more details.",
72
+ "content": {
73
+ "application/json": {
74
+ "schema": {
75
+ "$ref": "#/components/schemas/Error"
76
+ },
77
+ "examples": {
78
+ "exampleResponse": {
79
+ "value": {
80
+ "name": "GeneralError",
81
+ "message": "errorMessage",
82
+ "properties": {
83
+ "foo": "bar"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "401": {
92
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
93
+ "content": {
94
+ "application/json": {
95
+ "schema": {
96
+ "$ref": "#/components/schemas/Error"
97
+ },
98
+ "examples": {
99
+ "exampleResponse": {
100
+ "value": {
101
+ "name": "UnauthorizedError",
102
+ "message": "errorMessage"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "500": {
110
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
111
+ "content": {
112
+ "application/json": {
113
+ "schema": {
114
+ "$ref": "#/components/schemas/Error"
115
+ },
116
+ "examples": {
117
+ "exampleResponse": {
118
+ "value": {
119
+ "name": "InternalServerError",
120
+ "message": "errorMessage"
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
76
126
  }
77
127
  }
78
128
  },
@@ -89,8 +139,9 @@
89
139
  "in": "query",
90
140
  "required": false,
91
141
  "schema": {
92
- "$ref": "#/components/schemas/MetricType"
93
- }
142
+ "type": "string"
143
+ },
144
+ "example": "0"
94
145
  },
95
146
  {
96
147
  "name": "cursor",
@@ -147,6 +198,63 @@
147
198
  }
148
199
  }
149
200
  }
201
+ },
202
+ "400": {
203
+ "description": "The server cannot process the request, see the content for more details.",
204
+ "content": {
205
+ "application/json": {
206
+ "schema": {
207
+ "$ref": "#/components/schemas/Error"
208
+ },
209
+ "examples": {
210
+ "exampleResponse": {
211
+ "value": {
212
+ "name": "GeneralError",
213
+ "message": "errorMessage",
214
+ "properties": {
215
+ "foo": "bar"
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ },
223
+ "401": {
224
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
225
+ "content": {
226
+ "application/json": {
227
+ "schema": {
228
+ "$ref": "#/components/schemas/Error"
229
+ },
230
+ "examples": {
231
+ "exampleResponse": {
232
+ "value": {
233
+ "name": "UnauthorizedError",
234
+ "message": "errorMessage"
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "500": {
242
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
243
+ "content": {
244
+ "application/json": {
245
+ "schema": {
246
+ "$ref": "#/components/schemas/Error"
247
+ },
248
+ "examples": {
249
+ "exampleResponse": {
250
+ "value": {
251
+ "name": "InternalServerError",
252
+ "message": "errorMessage"
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
150
258
  }
151
259
  }
152
260
  }
@@ -204,6 +312,63 @@
204
312
  }
205
313
  }
206
314
  }
315
+ },
316
+ "400": {
317
+ "description": "The server cannot process the request, see the content for more details.",
318
+ "content": {
319
+ "application/json": {
320
+ "schema": {
321
+ "$ref": "#/components/schemas/Error"
322
+ },
323
+ "examples": {
324
+ "exampleResponse": {
325
+ "value": {
326
+ "name": "GeneralError",
327
+ "message": "errorMessage",
328
+ "properties": {
329
+ "foo": "bar"
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
335
+ }
336
+ },
337
+ "401": {
338
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
339
+ "content": {
340
+ "application/json": {
341
+ "schema": {
342
+ "$ref": "#/components/schemas/Error"
343
+ },
344
+ "examples": {
345
+ "exampleResponse": {
346
+ "value": {
347
+ "name": "UnauthorizedError",
348
+ "message": "errorMessage"
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ },
355
+ "500": {
356
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
357
+ "content": {
358
+ "application/json": {
359
+ "schema": {
360
+ "$ref": "#/components/schemas/Error"
361
+ },
362
+ "examples": {
363
+ "exampleResponse": {
364
+ "value": {
365
+ "name": "InternalServerError",
366
+ "message": "errorMessage"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
207
372
  }
208
373
  }
209
374
  },
@@ -250,12 +415,62 @@
250
415
  }
251
416
  },
252
417
  "responses": {
253
- "200": {
254
- "description": "The rest request ended in success with no data.",
418
+ "204": {
419
+ "description": "The rest request ended in success with no data."
420
+ },
421
+ "400": {
422
+ "description": "The server cannot process the request, see the content for more details.",
255
423
  "content": {
256
- "text/plain": {
424
+ "application/json": {
257
425
  "schema": {
258
- "$ref": "#/components/schemas/NoContentResponse"
426
+ "$ref": "#/components/schemas/Error"
427
+ },
428
+ "examples": {
429
+ "exampleResponse": {
430
+ "value": {
431
+ "name": "GeneralError",
432
+ "message": "errorMessage",
433
+ "properties": {
434
+ "foo": "bar"
435
+ }
436
+ }
437
+ }
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "401": {
443
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
444
+ "content": {
445
+ "application/json": {
446
+ "schema": {
447
+ "$ref": "#/components/schemas/Error"
448
+ },
449
+ "examples": {
450
+ "exampleResponse": {
451
+ "value": {
452
+ "name": "UnauthorizedError",
453
+ "message": "errorMessage"
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "500": {
461
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
462
+ "content": {
463
+ "application/json": {
464
+ "schema": {
465
+ "$ref": "#/components/schemas/Error"
466
+ },
467
+ "examples": {
468
+ "exampleResponse": {
469
+ "value": {
470
+ "name": "InternalServerError",
471
+ "message": "errorMessage"
472
+ }
473
+ }
259
474
  }
260
475
  }
261
476
  }
@@ -287,12 +502,62 @@
287
502
  }
288
503
  ],
289
504
  "responses": {
290
- "200": {
291
- "description": "The rest request ended in success with no data.",
505
+ "204": {
506
+ "description": "The rest request ended in success with no data."
507
+ },
508
+ "400": {
509
+ "description": "The server cannot process the request, see the content for more details.",
510
+ "content": {
511
+ "application/json": {
512
+ "schema": {
513
+ "$ref": "#/components/schemas/Error"
514
+ },
515
+ "examples": {
516
+ "exampleResponse": {
517
+ "value": {
518
+ "name": "GeneralError",
519
+ "message": "errorMessage",
520
+ "properties": {
521
+ "foo": "bar"
522
+ }
523
+ }
524
+ }
525
+ }
526
+ }
527
+ }
528
+ },
529
+ "401": {
530
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
531
+ "content": {
532
+ "application/json": {
533
+ "schema": {
534
+ "$ref": "#/components/schemas/Error"
535
+ },
536
+ "examples": {
537
+ "exampleResponse": {
538
+ "value": {
539
+ "name": "UnauthorizedError",
540
+ "message": "errorMessage"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ }
546
+ },
547
+ "500": {
548
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
292
549
  "content": {
293
- "text/plain": {
550
+ "application/json": {
294
551
  "schema": {
295
- "$ref": "#/components/schemas/NoContentResponse"
552
+ "$ref": "#/components/schemas/Error"
553
+ },
554
+ "examples": {
555
+ "exampleResponse": {
556
+ "value": {
557
+ "name": "InternalServerError",
558
+ "message": "errorMessage"
559
+ }
560
+ }
296
561
  }
297
562
  }
298
563
  }
@@ -349,15 +614,8 @@
349
614
  }
350
615
  },
351
616
  "responses": {
352
- "200": {
617
+ "201": {
353
618
  "description": "The rest request ended in created response.",
354
- "content": {
355
- "text/plain": {
356
- "schema": {
357
- "$ref": "#/components/schemas/CreatedResponse"
358
- }
359
- }
360
- },
361
619
  "headers": {
362
620
  "location": {
363
621
  "schema": {
@@ -366,6 +624,63 @@
366
624
  "description": "e.g. aabbccdd11223445566"
367
625
  }
368
626
  }
627
+ },
628
+ "400": {
629
+ "description": "The server cannot process the request, see the content for more details.",
630
+ "content": {
631
+ "application/json": {
632
+ "schema": {
633
+ "$ref": "#/components/schemas/Error"
634
+ },
635
+ "examples": {
636
+ "exampleResponse": {
637
+ "value": {
638
+ "name": "GeneralError",
639
+ "message": "errorMessage",
640
+ "properties": {
641
+ "foo": "bar"
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ },
649
+ "401": {
650
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
651
+ "content": {
652
+ "application/json": {
653
+ "schema": {
654
+ "$ref": "#/components/schemas/Error"
655
+ },
656
+ "examples": {
657
+ "exampleResponse": {
658
+ "value": {
659
+ "name": "UnauthorizedError",
660
+ "message": "errorMessage"
661
+ }
662
+ }
663
+ }
664
+ }
665
+ }
666
+ },
667
+ "500": {
668
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
669
+ "content": {
670
+ "application/json": {
671
+ "schema": {
672
+ "$ref": "#/components/schemas/Error"
673
+ },
674
+ "examples": {
675
+ "exampleResponse": {
676
+ "value": {
677
+ "name": "InternalServerError",
678
+ "message": "errorMessage"
679
+ }
680
+ }
681
+ }
682
+ }
683
+ }
369
684
  }
370
685
  }
371
686
  },
@@ -393,10 +708,7 @@
393
708
  "in": "query",
394
709
  "required": false,
395
710
  "schema": {
396
- "type": [
397
- "number",
398
- "string"
399
- ]
711
+ "type": "string"
400
712
  }
401
713
  },
402
714
  {
@@ -405,10 +717,7 @@
405
717
  "in": "query",
406
718
  "required": false,
407
719
  "schema": {
408
- "type": [
409
- "number",
410
- "string"
411
- ]
720
+ "type": "string"
412
721
  }
413
722
  },
414
723
  {
@@ -470,6 +779,63 @@
470
779
  }
471
780
  }
472
781
  }
782
+ },
783
+ "400": {
784
+ "description": "The server cannot process the request, see the content for more details.",
785
+ "content": {
786
+ "application/json": {
787
+ "schema": {
788
+ "$ref": "#/components/schemas/Error"
789
+ },
790
+ "examples": {
791
+ "exampleResponse": {
792
+ "value": {
793
+ "name": "GeneralError",
794
+ "message": "errorMessage",
795
+ "properties": {
796
+ "foo": "bar"
797
+ }
798
+ }
799
+ }
800
+ }
801
+ }
802
+ }
803
+ },
804
+ "401": {
805
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
806
+ "content": {
807
+ "application/json": {
808
+ "schema": {
809
+ "$ref": "#/components/schemas/Error"
810
+ },
811
+ "examples": {
812
+ "exampleResponse": {
813
+ "value": {
814
+ "name": "UnauthorizedError",
815
+ "message": "errorMessage"
816
+ }
817
+ }
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "500": {
823
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
824
+ "content": {
825
+ "application/json": {
826
+ "schema": {
827
+ "$ref": "#/components/schemas/Error"
828
+ },
829
+ "examples": {
830
+ "exampleResponse": {
831
+ "value": {
832
+ "name": "InternalServerError",
833
+ "message": "errorMessage"
834
+ }
835
+ }
836
+ }
837
+ }
838
+ }
473
839
  }
474
840
  }
475
841
  }
@@ -477,25 +843,69 @@
477
843
  },
478
844
  "components": {
479
845
  "schemas": {
846
+ "Error": {
847
+ "description": "Model to describe serialized error.",
848
+ "type": "object",
849
+ "properties": {
850
+ "name": {
851
+ "type": "string",
852
+ "description": "The name for the error."
853
+ },
854
+ "message": {
855
+ "type": "string",
856
+ "description": "The message for the error as an i18n key."
857
+ },
858
+ "source": {
859
+ "type": "string",
860
+ "description": "The source of the error."
861
+ },
862
+ "properties": {
863
+ "type": "object",
864
+ "additionalProperties": {},
865
+ "description": "Any additional information for the error."
866
+ },
867
+ "stack": {
868
+ "type": "string",
869
+ "description": "The stack trace for the error."
870
+ },
871
+ "cause": {
872
+ "$ref": "#/components/schemas/Error"
873
+ }
874
+ },
875
+ "required": [
876
+ "name",
877
+ "message"
878
+ ]
879
+ },
880
+ "MetricCounterOperation": {
881
+ "description": "The types of metric counter operations.",
882
+ "anyOf": [
883
+ {
884
+ "const": "inc",
885
+ "description": "Increment Counter."
886
+ },
887
+ {
888
+ "const": "dec",
889
+ "description": "Decrement Counter."
890
+ }
891
+ ]
892
+ },
480
893
  "MetricType": {
894
+ "description": "The types of metrics.",
481
895
  "anyOf": [
482
896
  {
483
- "type": "number",
484
897
  "const": 0,
485
898
  "description": "Counter."
486
899
  },
487
900
  {
488
- "type": "number",
489
901
  "const": 1,
490
902
  "description": "Increment Decrement Counter."
491
903
  },
492
904
  {
493
- "type": "number",
494
905
  "const": 2,
495
906
  "description": "Gauge."
496
907
  }
497
- ],
498
- "description": "The types of metrics."
908
+ ]
499
909
  },
500
910
  "TelemetryAddMetricValueRequest": {
501
911
  "type": "object",
@@ -503,12 +913,7 @@
503
913
  "value": {
504
914
  "anyOf": [
505
915
  {
506
- "type": "string",
507
- "const": "inc"
508
- },
509
- {
510
- "type": "string",
511
- "const": "dec"
916
+ "$ref": "#/components/schemas/MetricCounterOperation"
512
917
  },
513
918
  {
514
919
  "type": "number"
@@ -525,7 +930,6 @@
525
930
  "required": [
526
931
  "value"
527
932
  ],
528
- "additionalProperties": false,
529
933
  "description": "The data to be used in the update."
530
934
  },
531
935
  "TelemetryGetMetricResponse": {
@@ -542,7 +946,6 @@
542
946
  "metric",
543
947
  "value"
544
948
  ],
545
- "additionalProperties": false,
546
949
  "description": "The body parameters."
547
950
  },
548
951
  "TelemetryListResponse": {
@@ -563,10 +966,10 @@
563
966
  "required": [
564
967
  "entities"
565
968
  ],
566
- "additionalProperties": false,
567
969
  "description": "The response payload."
568
970
  },
569
971
  "TelemetryMetric": {
972
+ "description": "Interface describing a telemetry metric.",
570
973
  "type": "object",
571
974
  "properties": {
572
975
  "id": {
@@ -587,17 +990,20 @@
587
990
  "unit": {
588
991
  "type": "string",
589
992
  "description": "The unit the metric describes."
993
+ },
994
+ "maxHistory": {
995
+ "type": "number",
996
+ "description": "The maximum number of values to retain; oldest are trimmed on each addMetricValue call.\nUnlimited when absent."
590
997
  }
591
998
  },
592
999
  "required": [
593
1000
  "id",
594
1001
  "label",
595
1002
  "type"
596
- ],
597
- "additionalProperties": false,
598
- "description": "Interface describing a telemetry metric."
1003
+ ]
599
1004
  },
600
1005
  "TelemetryMetricValue": {
1006
+ "description": "Interface describing a telemetry metric value.",
601
1007
  "type": "object",
602
1008
  "properties": {
603
1009
  "id": {
@@ -622,9 +1028,7 @@
622
1028
  "id",
623
1029
  "ts",
624
1030
  "value"
625
- ],
626
- "additionalProperties": false,
627
- "description": "Interface describing a telemetry metric value."
1031
+ ]
628
1032
  },
629
1033
  "TelemetryUpdateMetricRequest": {
630
1034
  "type": "object",
@@ -645,7 +1049,6 @@
645
1049
  "required": [
646
1050
  "label"
647
1051
  ],
648
- "additionalProperties": false,
649
1052
  "description": "The data to be used in the update."
650
1053
  },
651
1054
  "TelemetryValuesListResponse": {
@@ -670,7 +1073,6 @@
670
1073
  "metric",
671
1074
  "entities"
672
1075
  ],
673
- "additionalProperties": false,
674
1076
  "description": "The response payload."
675
1077
  }
676
1078
  },