storage_openapi.yaml 27.7 KB
Newer Older
StephenWhitley's avatar
StephenWhitley committed
1
2
swagger: "2.0"
info:
StephenWhitley's avatar
StephenWhitley committed
3
  description: "Storage service which handles the metadata ingestion in the OSDU\
StephenWhitley's avatar
StephenWhitley committed
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
    \ ecosystem"
  version: "2.0.0"
  title: "Storage APIs"
  contact:
    name: "OSDU Data Platform Tesm team"
    email: "dps@[OSDU].org"
host: "storage-[OSDU].appspot.com"
basePath: "/api/storage/v2"
tags:
- name: "records"
  description: "Records management operations."
- name: "schemas"
  description: "Schema management"
- name: "query"
  description: "Record queries"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
paths:
  /query/kinds:
    get:
      tags:
      - "query"
      summary: "Get all kinds"
      description: "The API returns a list of all kinds in the specific {Account-Id}.\
        \ Allowed roles: service.storage.admin."
      operationId: "Get all kinds"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "cursor"
        in: "query"
        description: "Cursor"
        required: false
        type: "string"
      - name: "limit"
        in: "query"
        description: "Page Size"
        required: false
        type: "integer"
        default: 10
        format: "int32"
      - name: "OSDU-Account-Id"
        in: "header"
        description: "Account ID is the active account\
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "All kinds retrieved successfully."
          schema:
            $ref: "#/definitions/DatastoreQueryResult"
        500:
          description: "Unknown Error."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /query/records:
    get:
      tags:
      - "query"
      summary: "Get all record from kind"
      description: "The API returns a list of all record ids which belong to the specified\
        \ kind. Allowed roles: service.storage.admin."
      operationId: "Get all record from kind"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "cursor"
        in: "query"
        description: "Cursor"
        required: false
        type: "string"
      - name: "limit"
        in: "query"
        description: "Page Size"
        required: false
        type: "integer"
        default: 10
        format: "int32"
      - name: "kind"
        in: "query"
        description: "Filter Kind"
        required: false
        type: "string"
        default: "tenant1:public:well:1.0.2"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
111
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Record Ids retrieved successfully."
          schema:
            $ref: "#/definitions/DatastoreQueryResult"
        404:
          description: "Kind or cursor not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
    post:
      tags:
      - "query"
      summary: "Fetch records"
      description: "The API fetches multiple records at once. Allowed roles: service.storage.viewer,\
        \ service.storage.creator and service.storage.admin."
      operationId: "Fetch records"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        required: false
        schema:
          $ref: "#/definitions/MultiRecordIds"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
155
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Fetch multiple records successfully."
          schema:
            $ref: "#/definitions/MultiRecordIds"
        500:
          description: "Unknown storage error."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /records/{id}:delete:
    post:
      tags:
      - "records"
      summary: "Delete record"
      description: "The API performs a logical deletion of the given record. This\
        \ operation can be reverted later. Allowed roles: service.storage.creator\
        \ and service.storage.admin."
      operationId: "Delete record"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "Record id"
        required: true
        type: "string"
        default: "tenant1:well:123456789"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
202
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        204:
          description: "Record deleted successfully."
        404:
          description: "Record not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /records/{id}:
    get:
      tags:
      - "records"
      summary: "Get record"
      description: "This API returns the latest version of the given record. Allowed\
        \ roles: service.storage.viewer, service.storage.creator and service.storage.admin."
      operationId: "Get record"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "Record id"
        required: true
        type: "string"
        default: "tenant1:well:123456789"
      - name: "attribute"
        in: "query"
        description: "Filter attributes to restrict the returned fields of the record.\
          \ Usage: data.{record-data-field-name}."
        required: false
        type: "array"
        items:
          type: "string"
          default: "data.wellName"
        collectionFormat: "multi"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
256
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Record retrieved successfully."
          schema:
            $ref: "#/definitions/RecordData"
        404:
          description: "Record not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
    delete:
      tags:
      - "records"
      summary: "Purge record"
      description: "The API performs the physical deletion of the given record and\
        \ all of its versions. This operation cannot be undone. Allowed roles: service.storage.admin."
      operationId: "Purge record"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "Record id"
        required: true
        type: "string"
        default: "tenant1:well:123456789"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
301
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        204:
          description: "Record purged successfully."
        404:
          description: "Record not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /records/{id}/{version}:
    get:
      tags:
      - "records"
      summary: "Get record version"
      description: "The API retrieves the specific version of the given record. Allowed\
        \ roles: service.storage.viewer, service.storage.creator and service.storage.admin."
      operationId: "Get record version"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "Record id"
        required: true
        type: "string"
      - name: "version"
        in: "path"
        description: "Record version"
        required: true
        type: "integer"
        default: 123456789
        format: "int64"
      - name: "attribute"
        in: "query"
        description: "Filter attributes to restrict the returned fields of the record.\
          \ Usage: data.{record-data-field-name}."
        required: false
        type: "array"
        items:
          type: "string"
          default: "data.wellName"
        collectionFormat: "multi"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
361
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Record retrieved successfully."
          schema:
            $ref: "#/definitions/RecordData"
        404:
          description: "Record id or version not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /records/versions/{id}:
    get:
      tags:
      - "records"
      summary: "Get all record versions"
      description: "The API returns a list containing all versions for the given record\
        \ id. Allowed roles: service.storage.viewer, service.storage.creator and service.storage.admin."
      operationId: "Get all record versions"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "Record id"
        required: true
        type: "string"
        default: "tenant1:well:123456789"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
407
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Record versions retrieved successfully."
          schema:
            $ref: "#/definitions/RecordVersions"
        404:
          description: "Record id or version not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /records:
    put:
      tags:
      - "records"
      summary: "Create or update records"
      description: "The API represents the main injection mechanism into the Data\
        \ Lake. It allows records creation and/or update. When no record id is provided\
        \ or when the provided id is not already present in the Data Lake then a new\
        \ record is created. If the id is related to an existing record in the Data\
        \ Lake then an update operation takes place and a new version of the record\
        \ is created. Allowed roles: service.storage.creator and service.storage.admin."
      operationId: "Create or update records"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "skipdupes"
        in: "query"
        description: "Skip duplicates when updating records with the same value."
        required: false
        type: "boolean"
        default: true
      - in: "body"
        name: "body"
        required: false
        schema:
          type: "array"
          items:
            $ref: "#/definitions/Record"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
464
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        201:
          description: "Records created and/or updated successfully."
          schema:
            $ref: "#/definitions/Record"
        400:
          description: "Invalid record format."
          schema:
            $ref: "#/definitions/AppError"
        404:
          description: "Invalid acl group."
          schema:
            $ref: "#/definitions/AppError"
        403:
          description: "User not authorized to perform the action."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /schemas/{kind}:
    get:
      tags:
      - "schemas"
      summary: "Get schema"
      description: "The API returns the schema specified byt the given kind, which\
        \ must follow the naming convention {OSDU-Account-Id}:{dataset}:{type}:{version}.\
        \ Allowed roles: service.storage.viewer, service.storage.creator and service.storage.admin."
      operationId: "Get schema"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "kind"
        in: "path"
        description: "Kind"
        required: true
        type: "string"
        default: "tenant1:public:well:1.0.2"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
519
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        200:
          description: "Schema obtained successfully."
          schema:
            $ref: "#/definitions/Schema"
        400:
          description: "Bad request."
          schema:
            $ref: "#/definitions/AppError"
        404:
          description: "Schema not found for specified kind."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
    delete:
      tags:
      - "schemas"
      summary: "Delete a schema"
      description: "Allowed roles: service.storage.admin. Delete a schema by kind\
        \ in {OSDU-Account-Id}:{dataset}:{type}:{version} format."
      operationId: "Delete a schema"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "kind"
        in: "path"
        description: "Kind"
        required: true
        type: "string"
        default: "tenant1:public:well:1.0.2"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
568
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        204:
          description: "Schema deleted successfully."
        400:
          description: "Bad request."
          schema:
            $ref: "#/definitions/AppError"
        404:
          description: "Schema not found."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
  /schemas:
    post:
      tags:
      - "schemas"
      summary: "Create schema"
      description: "The API allows the creation of a new schema for the given kind.\
        \ Allowed roles: service.storage.creator and service.storage.admin."
      operationId: "Create schema"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        required: false
        schema:
          $ref: "#/definitions/Schema"
      - name: "OSDU-Account-Id"
        in: "header"
StephenWhitley's avatar
StephenWhitley committed
615
        description: "Account ID is the active OSDU account (OSDU account or customer's\
StephenWhitley's avatar
StephenWhitley committed
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
          \ account) which the users choose to use with the Search API."
        required: true
        type: "string"
        default: "tenant1"
      - name: "OSDU-On-Behalf-Of"
        in: "header"
        description: "On behalf email or token is the token/email of the original\
          \ user making the call. For now, only email is supported but eventually,\
          \ primary usage will be token."
        required: false
        type: "string"
      responses:
        201:
          description: "Schema created successfully."
          schema:
            $ref: "#/definitions/Schema"
        400:
          description: "Bad request."
          schema:
            $ref: "#/definitions/AppError"
        409:
          description: "Schema already registered."
          schema:
            $ref: "#/definitions/AppError"
      security:
      - datalake_auth:
        - "email"
      - Bearer: []  
securityDefinitions:
  datalake_auth:
    type: "oauth2"
    authorizationUrl: "https://accounts.google.com/o/oauth2/v2/auth"
    flow: "implicit"
    scopes:
      email: "User identity"
  #SAuth security configuration or the portal
  Bearer:
    type: apiKey
    name: Authorization
    in: header    
definitions:
  DatastoreQueryResult:
    type: "object"
    properties:
      cursor:
        type: "string"
      results:
        type: "array"
        items:
          type: "string"
  AppError:
    type: "object"
    properties:
      code:
        type: "integer"
        format: "int32"
      reason:
        type: "string"
      message:
        type: "string"
    description: "An error that occurs during normal application logic"
  MultiRecordInfo:
    type: "object"
    properties:
      records:
        type: "array"
        items:
          type: "string"
      invalidRecords:
        type: "array"
        items:
          type: "string"
      retryRecords:
        type: "array"
        items:
          type: "string"
    description: "Multiple Storage records."
  MultiRecordIds:
    type: "object"
    required:
    - "records"
    properties:
      records:
        type: "array"
        example: "tenant1:well:123456789"
        description: "List of record ids. Each record id must follow the naming convention\
          \ {OSDU-Account-Id}:{dataset-name}:{record-type}:{version}."
        items:
          type: "string"
      attributes:
        type: "array"
        example: "data.wellName"
        description: "Filter attributes to restrict the returned fields of the record.\
          \ Usage: data.{record-data-field-name}."
        allowEmptyValue: true
        items:
          type: "string"
    description: "Multiple storage record ids and filter attributes."
    example:
      records:
      - "tenant1:well:123456789"
      - "tenant1:wellTop:abc789456"
      - "tenant1:wellLog:654abc987"
      attributes:
      - "data.msg"
  RecordData:
    type: "object"
    properties:
      data:
        type: "object"
        additionalProperties:
          type: "object"
      meta:
        type: "array"
        items:
          type: "object"
          additionalProperties:
            type: "object"
    description: "Storage record"
  RecordVersions:
    type: "object"
    properties:
      recordId:
        type: "string"
      versions:
        type: "array"
        items:
          type: "integer"
          format: "int64"
    description: "Storage record versions."
  CreateUpdateRecordsResponse:
    type: "object"
    properties:
      recordCount:
        type: "integer"
        format: "int32"
        description: "Number of records ingested successfully."
      recordIds:
        type: "array"
        description: "List of ingested record id."
        items:
          type: "string"
      skippedRecordIds:
        type: "array"
        description: "List of record id that skipped update because it was a duplicate\
          \ of the existing record."
        items:
          type: "string"
    description: "Result of the ingestion request."
  Legal:
    type: "object"
    properties:
      legaltags:
        type: "array"
        description: "List of legaltag names associated with the record."
        uniqueItems: true
        items:
          type: "string"
      otherRelevantDataCountries:
        type: "array"
        description: "List of other relevant data countries. Must have 2 values: where\
          \ the data was ingested from and where Data Lake stores the data."
        uniqueItems: true
        items:
          type: "string"
  Record:
    type: "object"
    required:
    - "acl"
    - "data"
    - "kind"
    - "legal"
    properties:
      id:
        type: "string"
        example: "tenant1:well:123456789"
        description: "Unique identifier in whole Data Lake. When not provided, Data\
          \ Lake will create and assign an id to the record. Must follow the naming\
          \ convention: {OSDU-Account-Id}:{object-type}:{uuid}."
        pattern: "[\\w-\\.]+:[\\w-\\.]+:[\\w-\\.]+"
      kind:
        type: "string"
        example: "tenant1:public:well:1.0.2"
        description: "Kind of data it is being ingested. Must follow the naming convention:\
          \ {OSDU-Account-Id}:{dataset-name}:{record-type}:{version}."
      acl:
        description: "Group of users who have access to the record."
        $ref: "#/definitions/StorageAcl"
      legal:
        description: "Attributes which represent the legal constraints associated\
          \ with the record."
        $ref: "#/definitions/Legal"
      data:
        type: "object"
        description: "Record payload represented as a list of key-value pairs."
        additionalProperties:
          type: "object"
      history:
        description: "Record ancestry information."
        allowEmptyValue: true
        $ref: "#/definitions/RecordHistory"
    description: "Storage record"
    example:
    - id: "tenant1:well:123456789"
      kind: "tenant1:public:well:1.0.2"
      acl:
        viewers:
        - "my-viewer-group@[OSDU].com"
        owners:
        - "my-owner-group@[OSDU].com"
      legal:
        legaltags:
        - "sample-legal-tag"
        otherRelevantDataCountries:
        - "US"
      data:
        msg: "hello world from Data Lake"
      history:
        parents:
        - "OSDU:parent-record:1.0.0"
  RecordHistory:
    type: "object"
    properties:
      parents:
        type: "array"
        description: "List of parent records. Must follow the naming convention: {parent-record-id}:{parent-record-version}."
        allowEmptyValue: true
        uniqueItems: true
        items:
          type: "string"
  StorageAcl:
    type: "object"
    required:
    - "owners"
    - "viewers"
    properties:
      viewers:
        type: "array"
        description: "List of valid groups which will have view/read privileges over\
          \ the record."
        items:
          type: "string"
      owners:
        type: "array"
        description: "List of valid groups which will have write privileges over the\
          \ record."
        items:
          type: "string"
  Schema:
    type: "object"
    required:
    - "kind"
    - "schema"
    properties:
      kind:
        type: "string"
        example: "tenant1:public:well:1.0.2"
        description: "Record kind for which the schema information is applied to."
      schema:
        type: "array"
        description: "List of schema items which compose the schema."
        items:
          $ref: "#/definitions/SchemaItem"
    description: "Schema definition for the specified record kind."
    example:
      kind: "tenant1:public:well:1.0.2"
      schema:
      - path: "msg"
        kind: "string"
      - path: "year"
        kind: "int"
      - path: "weight"
        kind: "float"
      - path: "location"
        kind: "core:dl:geopoint"
      - path: "valid"
        kind: "bool"
  SchemaItem:
    type: "object"
    required:
    - "kind"
    - "path"
    properties:
      path:
        type: "string"
        description: "Schema item property name."
      kind:
        type: "string"
        description: "Schema item property data type."
        enum:
        - "string"
        - "int"
        - "float"
        - "double"
        - "long"
        - "boolean"
        - "link"
        - "datetime."
    description: "Schema item which describes schema properties and their data types."