-
Notifications
You must be signed in to change notification settings - Fork 108
/
apiary.apib
1404 lines (1223 loc) · 51.1 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://spagobi-url/SpagoBI/
TITLE: SpagoBI REST API 2.0
DATE: September 15th 2016
VERSION: 2.0
APIARY_PROJECT: spagobi
# SpagoBI REST API 2.0
This specification defines the SpagoBI REST API 2.0. SpagoBI REST API is intended to manage the lifecycle of SpagoBI analytical documents and datasets.
## Editors
+ Davide Zerbetto, Engineering Ingegneria Informatica S.p.A
## Acknowledgements
The editors would like to express their gratitude to the following people who actively contributed to this specification:
Monica Franceschini, Alessandro Daniele
## Status
This is a work in progress and is changing on a monthly basis.
This specification is licensed under the [FIWARE Open Specification License](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_%28implicit_patents_license%29).
Engineering Ingegneria Informatica S.p.A. provides the software associated to SpagoBI as open source: see details on the [SpagoBI web site](http://www.spagobi.org/homepage/opensource/license/).
## Copyright
Copyright © 2015 Engineering Ingegneria Informatica S.p.A.
All rights reserved.
##Authentication
In order to use RESTful API you will have to authenticate yourself. You can do that through basic authentication.
It is not however mandatory to send authentication information if you are already accessing the REST services through a browser and you are logged in SpagoBI, in that case the session will be used to retrieve profile information.
NB: there is no REST interfaces to manage users. This is because users authenticate using Fiware IdM. So, to manage users you can use IdM RESTful API (https://github.com/ging/fi-ware-idm/wiki/REST-API).
In the future will implement a second method of authentication: it will require that you send a token in all of your HTTP requests. We will add the token as a resource in our RESTful API so it will be possible to generate the token by sending a POST request to the token resource's url. The response will be a json object containing the token that will be used later on.
In this way, username and password will be required only the first time.
##Authorization
Each request will give you results accordingly to your roles and tenant (for example, if a document is not visible to members of your tenant it will not be in the list of documents).
Right now a user can be part at most of one tenant. In future we will probably extend SpagoBI such that a user could be part of more than one.
When this change will be applied, a request will return all the resources available for each tenant of the user. It will be however added a parameter for specify the tenant to give user the possibility to filter results accordingly to what he will be going to do.
##Errors
If the user is not authenticated the response status code will be 401
The other times an error appears the response code is 200 and the response body contains a json object containing the error messages.
+ Response (application/json)
{
"service": "",
"errors": [
{
"message": "Document with label [wrong_label] doesn't exist"
}
]
}
## The documents resource [/restful-services/2.0/documents]
The documents resource represents the list of documents that are visible to the authenticated user.
### List All Documents [GET]
+ Response 200 (application/json)
[
{
"id": 1,
"name": "Accessible sales costs",
"description": "",
"label": "Sales and costs",
"visible": true,
"stateCode": "REL",
"creationUser": "demo_admin",
"objMetaDataAndContents": null,
"tenant": "SPAGOBI",
"previewFile": null,
"docVersion": null,
"parametersRegion": "east",
"dataSourceLabel": "foodmart",
"dataSetLabel": "DEMO_SALES_COSTS",
"typeCode": "ACCESSIBLE_HTML",
"public": true,
"engine": "SpagoBIAccessibleEng",
"functionalities": [
"/Functionalities/DOC_DEMO/Accessibility"
],
"creationDate": "2015-04-20 10:12:08.0"
},
{
"id": 133,
"name": "Char Grouped Bar",
"description": "Char Grouped Bar",
"label": "Char Grouped Bar",
"visible": true,
"stateCode": "REL",
"creationUser": "biadmin",
"objMetaDataAndContents": null,
"tenant": "SPAGOBI",
"previewFile": null,
"docVersion": null,
"parametersRegion": "east",
"dataSourceLabel": "FoodmartHSQL",
"dataSetLabel": "DS_DEMO_EXTCHART",
"typeCode": "CHART",
"public": true,
"engine": "SpagoBIJSChartEngine",
"functionalities": [
"/Functionalities/DOC_DEMO/CHARTS"
],
"creationDate": "2014-01-23 11:56:59.0"
}
]
### Adds a new document [POST]
Before adding a new document, you have to pay attention to the fact that the document could depend on other objects, in particular a data source and/or a dataset objects.
In this case you have to create those objects first, using the standard web GUI. After you created those objects, you have to reference them by their label in 'dataSourceLabel' and 'dataSetLabel' request properties.
+ Request (application/json)
{
"name": "Accessible sales costs",
"description": "",
"label": "Sales and costs",
"visible": true,
"stateCode": "REL",
"creationUser": "demo_admin",
"objMetaDataAndContents": null,
"tenant": "SPAGOBI",
"previewFile": null,
"docVersion": null,
"parametersRegion": "east",
"dataSourceLabel": "foodmart",
"dataSetLabel": "DEMO_SALES_COSTS",
"typeCode": "ACCESSIBLE_HTML",
"public": true,
"engine": "SpagoBIAccessibleEng",
"functionalities": [
"/Functionalities/DOC_DEMO/Accessibility"
],
"creationDate": "2015-04-20 10:12:08.0"
}
+ Response 200 (application/json)
## The document resource [/restful-services/2.0/documents/{document_label}]
The document resource represents a specific document.
+ Parameters
+ document_label (string) - the document's label
### Return document with specified Label [GET]
+ Response 200 (application/json)
{
"id": 1,
"name": "Accessible sales costs",
"description": "",
"label": "Sales and costs",
"visible": true,
"stateCode": "REL",
"creationUser": "demo_admin",
"objMetaDataAndContents": null,
"tenant": "SPAGOBI",
"previewFile": null,
"docVersion": null,
"parametersRegion": "east",
"dataSourceLabel": "foodmart",
"dataSetLabel": "DEMO_SALES_COSTS",
"typeCode": "ACCESSIBLE_HTML",
"public": true,
"engine": "SpagoBIAccessibleEng",
"functionalities": [
"/Functionalities/DOC_DEMO/Accessibility"
],
"creationDate": "2015-04-20 10:12:08.0"
}
### Update the document [PUT]
+ Request (application/json)
{
"id": 1,
"name": "Accessible sales costs",
"description": "",
"label": "Sales and costs",
"visible": true,
"stateCode": "REL",
"creationUser": "demo_admin",
"objMetaDataAndContents": null,
"tenant": "SPAGOBI",
"previewFile": null,
"docVersion": null,
"parametersRegion": "east",
"dataSourceLabel": "foodmart",
"dataSetLabel": "DEMO_SALES_COSTS",
"typeCode": "ACCESSIBLE_HTML",
"public": true,
"engine": "SpagoBIAccessibleEng",
"functionalities": [
"/Functionalities/DOC_DEMO/Accessibility"
],
"creationDate": "2015-04-20 10:12:08.0"
}
+ Response 200 (application/json)
### Delete the document [DELETE]
+ Response 200 (application/json)
## The preview subresource [/restful-services/2.0/documents/{document_label}/preview]
An analytical document can optionally have a static preview file, typically a screenshot. In case the document has no preview, a response with status code 404 (Not found) is returned.
+ Parameters
+ document_label (string) - the document's label
### Return the preview file of the document specified by the document_label parameter [GET]
+ Response 200
+ Headers
Content-Disposition: attachment; filename="preview.JPG"
+ Body
Preview is a file, typically an image.
## The template subresource [/restful-services/2.0/documents/{document_label}/template]
The template resource is optional. It is however mandatory for some type of documents. The templates of a document are versioned, so if you add a new template, the old one will be not deleted.
+ Parameters
+ document_label (string) - the document's label
### Return template with Specified Label [GET]
+ Response 200
+ Headers
Content-Disposition: attachment; filename="my_file"
+ Body
Template is a file, generally an xml.
### Update the template [POST]
Pay attention to the fact that, if a high-level REST client is used, some header information could vary.
+ Request
+ Headers
Content-Type: multipart/form-data
Content-Disposition: form-data; name="file"; filename="my_file"
+ Body
Template is a file, generally an xml.
+ Response 200 (application/json)
### Delete the template [DELETE]
+ Response 200 (application/json)
## The parameters subresource [/restful-services/2.0/documents/{document_label}/parameters]
A document can have one ore more parameters (i.e. analytical drivers) associated; you must create the analytical driver before invoking this service.
+ Parameters
+ document_label (string) - the document's label
### Return parameters by document's label [GET]
+ Response 200 (application/json)
[
{
"id": 44,
"biObjectID": 8,
"parID": 4,
"parameter": {
"id": 4,
"description": "",
"length": null,
"label": "",
"name": "",
"type": "",
"mask": "",
"typeId": null,
"modality": "",
"modalityValue": null,
"modalityValueForDefault": null,
"defaultFormula": "",
"checks": null,
"temporal": false,
"functional": false
},
"label": "Prod. department",
"required": true,
"modifiable": 0,
"visible": 1,
"multivalue": false,
"colSpan": null,
"thickPerc": null,
"prog": 1,
"priority": 2,
"parameterUrlName": "ParDepartment",
"parameterValues": null,
"parameterValuesDescription": null,
"transientParmeters": false,
"parameterValuesRetriever": null,
"iterative": false
},
{
"id": 45,
"biObjectID": 8,
"parID": 3,
"parameter": {
"id": 3,
"description": "",
"length": null,
"label": "",
"name": "",
"type": "",
"mask": "",
"typeId": null,
"modality": "",
"modalityValue": null,
"modalityValueForDefault": null,
"defaultFormula": "",
"checks": null,
"temporal": false,
"functional": false
},
"label": "Age range",
"required": true,
"modifiable": 0,
"visible": 1,
"multivalue": false,
"colSpan": null,
"thickPerc": null,
"prog": 1,
"priority": 3,
"parameterUrlName": "ParAgeGroup",
"parameterValues": null,
"parameterValuesDescription": null,
"transientParmeters": false,
"parameterValuesRetriever": null,
"iterative": false
}
]
### Add a parameter [POST]
+ Request (application/json)
{
"biObjectID": 8,
"parID": 4,
"parameter": {
"id": 4,
"description": "",
"length": null,
"label": "",
"name": "",
"type": "",
"mask": "",
"typeId": null,
"modality": "",
"modalityValue": null,
"modalityValueForDefault": null,
"defaultFormula": "",
"checks": null,
"temporal": false,
"functional": false
},
"label": "Prod. department",
"required": true,
"modifiable": 0,
"visible": 1,
"multivalue": false,
"colSpan": null,
"thickPerc": null,
"prog": 1,
"priority": 2,
"parameterUrlName": "ParDepartment",
"parameterValues": null,
"parameterValuesDescription": null,
"transientParmeters": false,
"parameterValuesRetriever": null,
"iterative": false
}
+ Response 200 (application/json)
## The parameter subresource [/restful-services/2.0/documents/{document_label}/parameters/{par_id}]
Each parameter is seen as a resource (subresource of parameters) and is uniquely identified by its id.
+ Parameters
+ document_label (string) - the document's label
+ par_id (string) - the parameter's id
### Return Parameter with specified Id [GET]
+ Response 200 (application/json)
{
"id": 44,
"biObjectID": 8,
"parID": 4,
"parameter": {
"id": 4,
"description": "",
"length": null,
"label": "",
"name": "",
"type": "",
"mask": "",
"typeId": null,
"modality": "",
"modalityValue": null,
"modalityValueForDefault": null,
"defaultFormula": "",
"checks": null,
"temporal": false,
"functional": false
},
"label": "Prod. department",
"required": true,
"modifiable": 0,
"visible": 1,
"multivalue": false,
"colSpan": null,
"thickPerc": null,
"prog": 1,
"priority": 2,
"parameterUrlName": "ParDepartment",
"parameterValues": null,
"parameterValuesDescription": null,
"transientParmeters": false,
"parameterValuesRetriever": null,
"iterative": false
}
### Update the parameter [PUT]
+ Request (application/json)
{
"id": 44,
"biObjectID": 8,
"parID": 4,
"parameter": {
"id": 4,
"description": "",
"length": null,
"label": "",
"name": "",
"type": "",
"mask": "",
"typeId": null,
"modality": "",
"modalityValue": null,
"modalityValueForDefault": null,
"defaultFormula": "",
"checks": null,
"temporal": false,
"functional": false
},
"label": "Prod. department",
"required": true,
"modifiable": 0,
"visible": 1,
"multivalue": false,
"colSpan": null,
"thickPerc": null,
"prog": 1,
"priority": 2,
"parameterUrlName": "ParDepartment",
"parameterValues": null,
"parameterValuesDescription": null,
"transientParmeters": false,
"parameterValuesRetriever": null,
"iterative": false
}
+ Response 200 (application/json)
### Delete the parameter [DELETE]
+ Response 200 (application/json)
## The content subresource: document execution [/restful-services/2.0/documents/{document_label}/content]
This REST service applies to static reports, since they do not require user interaction.
Executing a document can be seen as the act of retrieving its content. For this reason, the content of a document is represented as a subresource of it.
+ Parameters
+ document_label (string) - the document's label
### Return the document content [POST]
Pre-requisite: you should have a static report defined (as analytical document) and running on SpagoBI Server (look at SpagoBI documentation in order to see how to define an analytical document of type report).
In order to execute the document you must put the document's parameters inside the body payload as a JSON object. The example shows JSON for parameter "country", notice that only "urlName" and "values" attributes are mandatory, because the system automatically detects which analytical driver is referred by specified "urlName". There is also the outputType parameter represented as queryParameter.
It accepts an output type, for example "HTML" or "PDF". The available output types depend from the kind of document. Check the available export types from the SpagoBI web application, inside the view of document.
+ Request (application/json)
+ Body
[
{
"id":"1",
"label":"Country",
"type":"string",
"urlName":"country",
"values":["Italy","USA"]
}
]
+ Response 200 (application/json)
+ Headers
Content-Disposition: attachment; filename="my_file"
+ Body
documents content as file
## The datasets [/restful-services/2.0/datasets]
CRUD operations for Datasets
### Returns the datasets [GET]
+ Request
+ Attributes
+ callback (string) - the callback function for the response, optional
+ Response 200 (application/json)
[
{
"active": true,
"categoryId": null,
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1437646316000,
"timeUp": null,
"userDe": null,
"userIn": "biadmin",
"userUp": null
},
"configuration": {
"Query": "select * from business_demo_meter",
"dataSource": "Cosmos",
"queryScript": "",
"queryScriptLanguage": ""
},
"description": null,
"id": {
"dsId": 4,
"organization": "SPAGOBI",
"versionNum": 7
},
"label": "Meter",
"metaVersion": null,
"metadata": {
"fieldsMeta": [
{
"alias": "id",
"fieldType": "ATTRIBUTE",
"name": "id",
"properties": {},
"type": "java.lang.String"
},
{
"alias": "recvtime",
"fieldType": "ATTRIBUTE",
"name": "recvtime",
"properties": {},
"type": "java.lang.String"
}
],
"properties": {
"resultNumber": "3276"
}
},
"name": "Meter",
"numRows": false,
"owner": "biadmin",
"parameters": [],
"persistTableName": "",
"persisted": false,
"pivotColumnName": null,
"pivotColumnValue": null,
"pivotRowName": null,
"publicDS": true,
"sbiVersionDe": null,
"sbiVersionIn": null,
"sbiVersionUp": null,
"scope": {
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1436791308000,
"timeUp": null,
"userDe": null,
"userIn": "server",
"userUp": null
},
"domainCd": "DS_SCOPE",
"domainNm": "Dataset scope",
"valueCd": "USER",
"valueDs": "Dataset scope",
"valueId": 185,
"valueNm": "User"
},
"scopeId": 185,
"timeDe": null,
"timeIn": null,
"timeUp": null,
"transformerId": null,
"type": "SbiQueryDataSet",
"userDe": null,
"userIn": null,
"userUp": null
},
{
"active": true,
"categoryId": 150,
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1441025411000,
"timeUp": null,
"userDe": null,
"userIn": "biadmin",
"userUp": null
},
"configuration": {
"restAddress": "http://192.168.2.137:1026/v1/queryContext",
"restDirectlyJSONAttributes": "false",
"restFetchSize": "limit",
"restHttpMethod": "Post",
"restJsonPathAttributes": [
{
"jsonPathType": "string",
"jsonPathValue": "pros3",
"name": "id"
}
],
"restJsonPathItems": "$",
"restMaxResults": "",
"restNGSI": "true",
"restOffset": "offset",
"restRequestBody": "{ \n \"entities\": [ \n {\n \"isPattern\": \"true\",\n \"type\":\"Meter\",\n \"id\": \".*\"\n }\n ]\n}",
"restRequestHeaders": {
"Accept": "application/json",
"Content-Type": "application/json"
}
},
"description": "Meters Values",
"id": {
"dsId": 5,
"organization": "SPAGOBI",
"versionNum": 10
},
"label": "RestMetersValues",
"metaVersion": null,
"metadata": {
"fieldsMeta": [
{
"alias": "upstreamActivePower",
"fieldType": "ATTRIBUTE",
"name": "upstreamActivePower",
"properties": {
"jsonPathValue": "$.contextResponses[?(@.contextElement.id==pros3_Meter)].contextElement.attributes[?(@.name==upstreamActivePower)].value"
},
"type": "java.lang.Double"
},
{
"alias": "downstreamActivePower",
"fieldType": "ATTRIBUTE",
"name": "downstreamActivePower",
"properties": {
"jsonPathValue": "$.contextResponses[?(@.contextElement.id==pros3_Meter)].contextElement.attributes[?(@.name==downstreamActivePower)].value"
},
"type": "java.lang.Double"
}
],
"properties": {}
},
"name": "RestMetersValues",
"numRows": false,
"owner": "biadmin",
"parameters": [],
"persistTableName": "",
"persisted": false,
"pivotColumnName": null,
"pivotColumnValue": null,
"pivotRowName": null,
"publicDS": true,
"sbiVersionDe": null,
"sbiVersionIn": null,
"sbiVersionUp": null,
"scope": null,
"scopeId": null,
"timeDe": null,
"timeIn": null,
"timeUp": null,
"transformerId": null,
"type": "SbiRESTDataSet",
"userDe": null,
"userIn": null,
"userUp": null
},
{
"active": true,
"categoryId": null,
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1440514105000,
"timeUp": null,
"userDe": null,
"userIn": "biadmin",
"userUp": null
},
"configuration": {
"Query": "select *",
"dataSource": "Cosmos",
"queryScript": "",
"queryScriptLanguage": ""
},
"description": null,
"id": {
"dsId": 6,
"organization": "SPAGOBI",
"versionNum": 1
},
"label": "LoadCosmos",
"metaVersion": null,
"metadata": null,
"name": "LoadCosmos",
"numRows": false,
"owner": "biadmin",
"parameters": [],
"persistTableName": "",
"persisted": false,
"pivotColumnName": null,
"pivotColumnValue": null,
"pivotRowName": null,
"publicDS": true,
"sbiVersionDe": null,
"sbiVersionIn": null,
"sbiVersionUp": null,
"scope": null,
"scopeId": null,
"timeDe": null,
"timeIn": null,
"timeUp": null,
"transformerId": null,
"type": "SbiQueryDataSet",
"userDe": null,
"userIn": null,
"userUp": null
},
{
"active": true,
"categoryId": 150,
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1441189575000,
"timeUp": null,
"userDe": null,
"userIn": "biadmin",
"userUp": null
},
"configuration": {
"restAddress": "http://192.168.2.137:1026/v1/queryContext",
"restDirectlyJSONAttributes": "false",
"restFetchSize": "",
"restHttpMethod": "Post",
"restJsonPathAttributes": [],
"restJsonPathItems": "",
"restMaxResults": "",
"restNGSI": "true",
"restOffset": "",
"restRequestBody": "{ \n \"entities\": [ \n {\n \"isPattern\": \"true\",\n \"type\":\"Meter\",\n \"id\": \".*\"\n }\n ]\n}",
"restRequestHeaders": {}
},
"description": "Rest1 Desc",
"id": {
"dsId": 7,
"organization": "SPAGOBI",
"versionNum": 2
},
"label": "Rest2",
"metaVersion": null,
"metadata": {
"fieldsMeta": [
{
"alias": "id",
"fieldType": "ATTRIBUTE",
"name": "id",
"properties": {
"jsonPathValue": "$.id"
},
"type": "java.lang.String"
},
{
"alias": "atTime",
"fieldType": "ATTRIBUTE",
"name": "atTime",
"properties": {
"dateFormat": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
"jsonPathType": "$.attributes[?(@.name==atTime)].type",
"jsonPathValue": "$.attributes[?(@.name==atTime)].value"
},
"type": "java.util.Date"
}
],
"properties": {}
},
"name": "Rest2",
"numRows": false,
"owner": "biadmin",
"parameters": [],
"persistTableName": "",
"persisted": false,
"pivotColumnName": null,
"pivotColumnValue": null,
"pivotRowName": null,
"publicDS": true,
"sbiVersionDe": null,
"sbiVersionIn": null,
"sbiVersionUp": null,
"scope": null,
"scopeId": null,
"timeDe": null,
"timeIn": null,
"timeUp": null,
"transformerId": null,
"type": "SbiRESTDataSet",
"userDe": null,
"userIn": null,
"userUp": null
}
]
### Add a dataset [POST]
+ Request (application/json)
{
"active": true,
"categoryId": null,
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1437646316000,
"timeUp": null,
"userDe": null,
"userIn": "biadmin",
"userUp": null
},
"configuration": {
"Query": "select * from business_demo_meter",
"dataSource": "Cosmos",
"queryScript": "",
"queryScriptLanguage": ""
},
"description": null,
"id": {
"dsId": 4,
"organization": "SPAGOBI",
"versionNum": 7
},
"label": "Meter",
"metaVersion": null,
"metadata": {
"fieldsMeta": [
{
"alias": "id",
"fieldType": "ATTRIBUTE",
"name": "id",
"properties": {},
"type": "java.lang.String"
},
{
"alias": "recvtime",
"fieldType": "ATTRIBUTE",
"name": "recvtime",
"properties": {},
"type": "java.lang.String"
}
],
"properties": {
"resultNumber": "3276"
}
},
"name": "Meter",
"numRows": false,
"owner": "biadmin",
"parameters": [],
"persistTableName": "",
"persisted": false,
"pivotColumnName": null,
"pivotColumnValue": null,
"pivotRowName": null,
"publicDS": true,
"sbiVersionDe": null,
"sbiVersionIn": null,
"sbiVersionUp": null,
"scope": {
"commonInfo": {
"organization": null,
"sbiVersionDe": null,
"sbiVersionIn": "4.0",
"sbiVersionUp": null,
"timeDe": null,
"timeIn": 1436791308000,
"timeUp": null,
"userDe": null,
"userIn": "server",
"userUp": null
},
"domainCd": "DS_SCOPE",
"domainNm": "Dataset scope",
"valueCd": "USER",
"valueDs": "Dataset scope",
"valueId": 185,
"valueNm": "User"
},