-
Notifications
You must be signed in to change notification settings - Fork 0
/
agrids-fiwire-ngsiv2-openapi.json
4712 lines (4712 loc) · 158 KB
/
agrids-fiwire-ngsiv2-openapi.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "AGRIDS FIWARE-NGSI v2 Specification",
"description": "API for the AGRIDS vineyard robotic map and data storage project."
},
"host": "orion.lab.fiware.org",
"basePath": "/",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/v2": {
"get": {
"description": "This resource does not have any attributes. Instead it offers the initial\nAPI affordances in the form of the links in the JSON body.\nIt is recommended to follow the \u201curl\u201d link values,\n[Link](https://tools.ietf.org/html/rfc5988) or Location headers where\napplicable to retrieve resources. Instead of constructing your own URLs,\nto keep your client decoupled from implementation details.",
"summary": "Retrieve API Resources",
"tags": [
"API Entry Point"
],
"operationId": "Retrieve API Resources",
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/RetrieveApiResourcesResponse"
},
"examples": {
"application/json": {
"entities_url": "/v2/entities",
"types_url": "/v2/types",
"subscriptions_url": "/v2/subscriptions",
"registrations_url": "/v2/registrations"
}
}
}
},
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/v2"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "RAW",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {
"Content-Type": "application/json"
},
"body": "{ \"entities_url\": \"/v2/entities\", \"types_url\": \"/v2/types\", \"subscriptions_url\": \"/v2/subscriptions\", \"registrations_url\": \"/v2/registrations\"}"
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "Retrieve API Resources1",
"x-testDescription": "This resource does not have any attributes. Instead it offers the initial\nAPI affordances in the form of the links in the JSON body.\nIt is recommended to follow the \u201curl\u201d link values,\n[Link](https://tools.ietf.org/html/rfc5988) or Location headers where\napplicable to retrieve resources. Instead of constructing your own URLs,\nto keep your client decoupled from implementation details."
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/v2/entities": {
"get": {
"description": "Retrieves a list of entities that match different criteria by id, type, pattern matching (either id or type)\nand/or those which match a query or geographical query (see [Simple Query Language](#simple_query_language) and \n[Geographical Queries](#geographical_queries)). A given entity has to match all the criteria to be retrieved\n(i.e., the criteria is combined in a logical AND way). Note that pattern matching query parameters are incompatible\n(i.e. mutually exclusive) with their corresponding exact matching parameters, i.e. `idPattern` with `id` and\n`typePattern` with `type`.\nThe response payload is an array containing one object per matching entity. Each entity follows\nthe JSON entity representation format (described in \"JSON Entity Representation\" section).\nResponse code:\n* Successful operation uses 200 OK\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "List Entities",
"tags": [
"Entities"
],
"operationId": "List Entities",
"produces": [
"application/json"
],
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"type": "string",
"description": "A comma-separated list of elements.\nRetrieve entities whose ID matches one of the elements in the list.\nIncompatible with `idPattern`."
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "comma-separated list of elements.\nRetrieve entities whose type matches one of the elements in the list.\nIncompatible with `typePattern`."
},
{
"name": "idPattern",
"in": "query",
"required": false,
"type": "string",
"description": "A correctly formated regular expression.\nRetrieve entities whose ID matches the regular expression. Incompatible with `id`."
},
{
"name": "typePattern",
"in": "query",
"required": false,
"type": "string",
"description": "A correctly formated regular expression.\nRetrieve entities whose type matches the regular expression. Incompatible with `type`."
},
{
"name": "q",
"in": "query",
"required": false,
"type": "string",
"description": "A query expression, composed of a list of statements\nseparated by `;`, i.e., q=statement1;statement2;statement3.\nSee [Simple Query Language specification](#simple_query_language)."
},
{
"name": "mq",
"in": "query",
"required": false,
"type": "string",
"description": "A query expression for attribute metadata,\ncomposed of a list of statements separated by `;`, i.e., mq=statement1;statement2;statement3.\nSee [Simple Query Language specification](#simple_query_language)."
},
{
"name": "georel",
"in": "query",
"required": false,
"type": "string",
"description": "Spatial relationship between matching entities and a\nreference shape. See [Geographical Queries](#geographical_queries)."
},
{
"name": "geometry",
"in": "query",
"required": false,
"type": "string",
"description": "Geografical area to which the query is restricted.\nSee [Geographical Queries](#geographical_queries)."
},
{
"name": "coords",
"in": "query",
"required": false,
"type": "string",
"description": "List of latitude-longitude\npairs of coordinates separated by ';'. See [Geographical Queries](#geographical_queries)."
},
{
"name": "limit",
"in": "query",
"required": false,
"type": "number",
"format": "double",
"exclusiveMaximum": false,
"exclusiveMinimum": false,
"description": "Limits the number of entities to be retrieved"
},
{
"name": "offset",
"in": "query",
"required": false,
"type": "number",
"format": "double",
"exclusiveMaximum": false,
"exclusiveMinimum": false,
"description": "Establishes the offset from where entities are retrieved"
},
{
"name": "attrs",
"in": "query",
"required": false,
"type": "string",
"description": "Comma-separated list of attribute names whose data\nare to be included in the response.\nThe attributes are retrieved in the order specified by this parameter. If this parameter is\nnot included, the attributes are retrieved in arbitrary order.\nSee \"Filtering out attributes and metadata\" section for more detail."
},
{
"name": "metadata",
"in": "query",
"required": false,
"type": "string",
"description": "A list of metadata names to include in the response.\nSee \"Filtering out attributes and metadata\" section for more detail."
},
{
"name": "orderBy",
"in": "query",
"required": false,
"type": "string",
"description": "Criteria for ordering results.\nSee \"Ordering Results\" section for details."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"count",
"keyValues",
"values",
"unique"
],
"x-enum-elements": [
{
"name": "count",
"description": ""
},
{
"name": "keyValues",
"description": ""
},
{
"name": "values",
"description": ""
},
{
"name": "unique",
"description": ""
}
],
"type": "string",
"description": "Options dictionary"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ListEntitiesResponse"
}
},
"examples": {
"application/json": [
{
"type": "Room",
"id": "DC_S1-D41",
"temperature": {
"value": 35.6,
"type": "Number",
"metadata": {}
}
},
{
"type": "Room",
"id": "Boe-Idearium",
"temperature": {
"value": 22.5,
"type": "Number",
"metadata": {}
}
},
{
"type": "Car",
"id": "P-9873-K",
"speed": {
"value": 100,
"type": "number",
"metadata": {
"accuracy": {
"value": 2,
"type": "Number"
},
"timestamp": {
"value": "2015-06-04T07:20:27.378Z",
"type": "DateTime"
}
}
}
}
]
}
}
},
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/v2/entities?id=Boe_Idearium&type=Room&idPattern=Bode_.*&typePattern=Room_.*&q=temperature>40&mq=temperature.accuracy<0.9&georel=near&geometry=point&coords=41.390205,2.154007;48.8566,2.3522&limit=20&offset=20&attrs=seatNumber&metadata=accuracy&orderBy=temperature,!speed"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "RAW",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {
"Content-Type": "application/json"
},
"body": "[ { \"type\": \"Room\", \"id\": \"DC_S1-D41\", \"temperature\": { \"value\": 35.6, \"type\": \"Number\", \"metadata\": {} } }, { \"type\": \"Room\", \"id\": \"Boe-Idearium\", \"temperature\": { \"value\": 22.5, \"type\": \"Number\", \"metadata\": {} } }, { \"type\": \"Car\", \"id\": \"P-9873-K\", \"speed\": { \"value\": 100, \"type\": \"number\", \"metadata\": { \"accuracy\": { \"value\": 2, \"type\": \"Number\" }, \"timestamp\": { \"value\": \"2015-06-04T07:20:27.378Z\", \"type\": \"DateTime\" } } } }]"
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "List Entities1",
"x-testDescription": "Retrieves a list of entities that match different criteria by id, type, pattern matching (either id or type)\nand/or those which match a query or geographical query (see [Simple Query Language](#simple_query_language) and \n[Geographical Queries](#geographical_queries)). A given entity has to match all the criteria to be retrieved\n(i.e., the criteria is combined in a logical AND way). Note that pattern matching query parameters are incompatible\n(i.e. mutually exclusive) with their corresponding exact matching parameters, i.e. `idPattern` with `id` and\n`typePattern` with `type`.\nThe response payload is an array containing one object per matching entity. Each entity follows\nthe JSON entity representation format (described in \"JSON Entity Representation\" section).\nResponse code:\n* Successful operation uses 200 OK\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"post": {
"description": "The payload is an object representing the entity to be created. The object follows\nthe JSON entity representation format (described in a \"JSON Entity Representation\" section).\nResponse:\n* Successful operation uses 201 Created (if upsert option is not used) or 204 No Content (if\n upsert option is used). Response includes a `Location` header with the URL of the\n created entity.\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Create Entity",
"tags": [
"Entities"
],
"operationId": "Create Entity",
"produces": [
"application/json"
],
"parameters": [
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"description": ""
},
{
"name": "body",
"in": "body",
"required": true,
"description": "",
"schema": {
"$ref": "#/definitions/CreateEntityRequest"
}
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"keyValues",
"upsert"
],
"x-enum-elements": [
{
"name": "keyValues",
"description": ""
},
{
"name": "upsert",
"description": ""
}
],
"type": "string",
"description": "Options dictionary"
}
],
"responses": {
"204": {
"description": ""
}
},
"x-unitTests": [
{
"request": {
"method": "POST",
"uri": "/v2/entities",
"headers": {
"Content-Type": "application/json"
},
"body": "{ \"type\": \"Room\", \"id\": \"Bcn-Welt\", \"temperature\": { \"value\": 21.7 }, \"humidity\": { \"value\": 60 }, \"location\": { \"value\": \"41.3763726, 2.1864475\", \"type\": \"geo:point\", \"metadata\": { \"crs\": { \"value\": \"WGS84\" } } }}"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "NONE",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {
"Location": "/v2/entities/Bcn-Welt?type=Room"
}
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "Create Entity1",
"x-testDescription": "The payload is an object representing the entity to be created. The object follows\nthe JSON entity representation format (described in a \"JSON Entity Representation\" section).\nResponse:\n* Successful operation uses 201 Created (if upsert option is not used) or 204 No Content (if\n upsert option is used). Response includes a `Location` header with the URL of the\n created entity.\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/v2/entities/{entityId}": {
"get": {
"description": "The response is an object representing the entity identified by the ID. The object follows\nthe JSON entity representation format (described in \"JSON Entity Representation\" section).\nThis operation must return one entity element only, but there may be more than one entity with the\nsame ID (e.g. entities with same ID but different types).\nIn such case, an error message is returned, with the HTTP status code set to 409 Conflict.\nResponse:\n* Successful operation uses 200 OK\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for more details.",
"summary": "Retrieve Entity",
"tags": [
"Entities"
],
"operationId": "Retrieve Entity",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity to be retrieved"
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "attrs",
"in": "query",
"required": false,
"type": "string",
"description": "Comma-separated list of attribute names whose\ndata must be included in the response. The attributes are retrieved in the order specified by\nthis parameter. See \"Filtering out attributes and metadata\" section for more detail.\nIf this parameter is not included, the attributes are retrieved in arbitrary order, and all\nthe attributes of the entity are included in the response."
},
{
"name": "metadata",
"in": "query",
"required": false,
"type": "string",
"description": "A list of metadata names to include in the response.\nSee \"Filtering out attributes and metadata\" section for more detail."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"keyValues",
"values",
"unique"
],
"x-enum-elements": [
{
"name": "keyValues",
"description": ""
},
{
"name": "values",
"description": ""
},
{
"name": "unique",
"description": ""
}
],
"type": "string",
"description": "Options dictionary"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/RetrieveEntityResponse"
},
"examples": {
"application/json": {
"type": "Room",
"id": "Bcn_Welt",
"temperature": {
"value": 21.7,
"type": "Number"
},
"humidity": {
"value": 60,
"type": "Number"
},
"location": {
"value": "41.3763726, 2.1864475",
"type": "geo:point",
"metadata": {
"crs": {
"value": "WGS84",
"type": "Text"
}
}
}
}
}
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"delete": {
"description": "Delete the entity.\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Remove Entity",
"tags": [
"Entities"
],
"operationId": "Remove Entity",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity to be deleted"
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
}
],
"responses": {
"204": {
"description": ""
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/v2/entities/{entityId}/attrs": {
"get": {
"description": "This request is similar to retreiving the whole entity, however this one omits the `id` and `type`\nfields.\nJust like the general request of getting an entire entity, this operation must return only one\nentity element. If more than one entity with the same ID is found (e.g. entities with\nsame ID but different type), an error message is returned, with the HTTP status code set to\n409 Conflict.\nResponse:\n* Successful operation uses 200 OK\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Retrieve Entity Attributes",
"tags": [
"Entities"
],
"operationId": "Retrieve Entity Attributes",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity to be retrieved"
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "attrs",
"in": "query",
"required": false,
"type": "string",
"description": "Comma-separated list of attribute names whose\ndata are to be included in the response. The attributes are retrieved in the order specified\nby this parameter.\nIf this parameter is not included, the attributes are retrieved in arbitrary order, and all\nthe attributes of the entity are included in the response.\nSee \"Filtering out attributes and metadata\" section for more detail."
},
{
"name": "metadata",
"in": "query",
"required": false,
"type": "string",
"description": "A list of metadata names to include in the response.\nSee \"Filtering out attributes and metadata\" section for more detail."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"keyValues",
"values",
"unique"
],
"x-enum-elements": [
{
"name": "keyValues",
"description": ""
},
{
"name": "values",
"description": ""
},
{
"name": "unique",
"description": ""
}
],
"type": "string",
"description": "Options dictionary"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/RetrieveEntityAttributesResponse"
},
"examples": {
"application/json": {
"temperature": {
"value": 21.7,
"type": "Number"
},
"humidity": {
"value": 60,
"type": "Number"
},
"location": {
"value": "41.3763726, 2.1864475",
"type": "geo:point",
"metadata": {
"crs": {
"value": "WGS84",
"type": "Text"
}
}
}
}
}
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"put": {
"description": "The request payload is an object representing the new entity attributes. The object follows\nthe JSON entity representation format (described in a \"JSON Entity Representation\" above), except\nthat `id` and `type` are not allowed.\nThe attributes previously existing in the entity are removed and replaced by the ones in the\nrequest.\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Replace all entity attributes",
"tags": [
"Entities"
],
"operationId": "Replace all entity attributes",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity in question."
},
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"description": ""
},
{
"name": "body",
"in": "body",
"required": true,
"description": "",
"schema": {
"$ref": "#/definitions/ReplaceAllEntityAttributesRequest"
}
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"keyValues"
],
"x-enum-elements": [
{
"name": "keyValues",
"description": ""
}
],
"type": "string",
"description": "Operations options"
}
],
"responses": {
"204": {
"description": ""
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"post": {
"description": "The request payload is an object representing the attributes to append or update. The object follows\nthe JSON entity representation format (described in \"JSON Entity Representation\" section), except\nthat `id` and `type` are not allowed.\nThe entity attributes are updated with the ones in the payload, depending on\nwhether the `append` operation option is used or not.\n* If `append` is not used: the entity attributes are updated (if they previously exist) or appended\n (if they don't previously exist) with the ones in the payload.\n* If `append` is used (i.e. strict append semantics): all the attributes in the payload not\n previously existing in the entity are appended. In addition to that, in case some of the\n attributes in the payload already exist in the entity, an error is returned.\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Update or Append Entity Attributes",
"tags": [
"Entities"
],
"operationId": "Update or Append Entity Attributes",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Entity id to be updated"
},
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"description": ""
},
{
"name": "body",
"in": "body",
"required": true,
"description": "",
"schema": {
"$ref": "#/definitions/UpdateOrAppendEntityAttributesRequest"
}
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"append",
"keyValues"
],
"x-enum-elements": [
{
"name": "append",
"description": ""
},
{
"name": "keyValues",
"description": ""
}
],
"type": "string",
"description": "Operations options"
}
],
"responses": {
"204": {
"description": ""
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"patch": {
"description": "The request payload is an object representing the attributes to update. The object follows\nthe JSON entity representation format (described in \"JSON Entity Representation\" section), except\nthat `id` and `type` are not allowed.\nThe entity attributes are updated with the ones in the payload. In addition to that, if one or more\nattributes in the payload doesn't exist in the entity, an error is returned.\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Update Existing Entity Attributes",
"tags": [
"Entities"
],
"operationId": "Update Existing Entity Attributes",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity to be updated"
},
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"description": ""
},
{
"name": "body",
"in": "body",
"required": true,
"description": "",
"schema": {
"$ref": "#/definitions/UpdateExistingEntityAttributesRequest"
}
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "options",
"in": "query",
"required": false,
"enum": [
"keyValues"
],
"x-enum-elements": [
{
"name": "keyValues",
"description": ""
}
],
"type": "string",
"description": "Operations options"
}
],
"responses": {
"204": {
"description": ""
}
},
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/v2/entities/{entityId}/attrs/{attrName}": {
"get": {
"description": "Returns a JSON object with the attribute data of the attribute. The object follows the JSON\nrepresentation for attributes (described in \"JSON Attribute Representation\" section).\nResponse:\n* Successful operation uses 200 OK.\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Get attribute data",
"tags": [
"Attributes"
],
"operationId": "Get attribute data",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity"
},
{
"name": "attrName",
"in": "path",
"required": true,
"type": "string",
"description": "Name of the attribute to be retrieved."
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
},
{
"name": "metadata",
"in": "query",
"required": false,
"type": "string",
"description": "A list of metadata names to include in the response.\nSee \"Filtering out attributes and metadata\" section for more detail."
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/GetAttributeDataResponse"
},
"examples": {
"application/json": {
"value": 21.7,
"type": "Number",
"metadata": {}
}
}
}
},
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/v2/entities/Bcn_Welt/attrs/temperature?metadata=accuracy"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "RAW",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {
"Content-Type": "application/json"
},
"body": "{ \"value\": 21.7, \"type\": \"Number\", \"metadata\": {}}"
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "Get attribute data1",
"x-testDescription": "Returns a JSON object with the attribute data of the attribute. The object follows the JSON\nrepresentation for attributes (described in \"JSON Attribute Representation\" section).\nResponse:\n* Successful operation uses 200 OK.\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"put": {
"description": "The request payload is an object representing the new attribute data. Previous attribute data\nis replaced by the one in the request. The object follows the JSON representation for attributes\n(described in \"JSON Attribute Representation\" section).\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details.",
"summary": "Update Attribute Data",
"tags": [
"Attributes"
],
"operationId": "Update Attribute Data",
"produces": [
"application/json"
],
"parameters": [
{
"name": "entityId",
"in": "path",
"required": true,
"type": "string",
"description": "Id of the entity to update"
},
{
"name": "attrName",
"in": "path",
"required": true,
"type": "string",
"description": "Attribute name"
},
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"description": ""
},
{
"name": "body",
"in": "body",
"required": true,
"description": "",
"schema": {
"$ref": "#/definitions/UpdateAttributeDataRequest"
}
},
{
"name": "type",
"in": "query",
"required": false,
"type": "string",
"description": "Entity type, to avoid ambiguity in case there are several\nentities with the same entity id."
}