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
|
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. _dcae-component-schema:
Component JSON Schema Definition
================================
The schema file used for DCAE onboarding is maintained in `gerrit <https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json>`__
The same is provided below for documentation reference.
::
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Component specification schema",
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"version": {
"$ref": "#/definitions/version"
},
"description": {
"type": "string"
},
"component_type": {
"type": "string",
"enum": [
"docker",
"cdap"
]
},
"name": {
"$ref": "#/definitions/name"
}
},
"required": [
"version",
"name",
"description",
"component_type"
]
},
"streams": {
"type": "object",
"properties": {
"publishes": {
"type": "array",
"uniqueItems": true,
"items": {
"oneOf": [
{ "$ref": "#/definitions/publisher_http" },
{ "$ref": "#/definitions/publisher_message_router" },
{ "$ref": "#/definitions/publisher_data_router" }
]
}
},
"subscribes": {
"type": "array",
"uniqueItems": true,
"items": {
"oneOf": [
{ "$ref": "#/definitions/subscriber_http" },
{ "$ref": "#/definitions/subscriber_message_router" },
{ "$ref": "#/definitions/subscriber_data_router" }
]
}
}
},
"required": [
"publishes",
"subscribes"
]
},
"services": {
"type": "object",
"properties": {
"calls": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/caller"
}
},
"provides": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/provider"
}
}
},
"required": [
"calls",
"provides"
]
},
"parameters" : {
"anyOf" : [
{"$ref": "#/definitions/docker-parameters"},
{"$ref": "#/definitions/cdap-parameters"}
]
},
"auxilary": {
"oneOf" : [
{"$ref": "#/definitions/auxilary_cdap"},
{"$ref": "#/definitions/auxilary_docker"}
]
},
"artifacts": {
"type": "array",
"description": "List of component artifacts",
"items": {
"$ref": "#/definitions/artifact"
}
},
"policy_info": {
"type": "object",
"properties": {
"policy":
{
"type": "array",
"items":
{
"type": "object",
"properties":
{
"node_label":
{
"type": "string"
},
"policy_id":
{
"type": "string"
},
"policy_model_id":
{
"type": "string"
}
},
"required": ["node_label", "policy_model_id"]
}
}
},
"additionalProperties": false
}
},
"required": [
"self",
"streams",
"services",
"parameters",
"auxilary",
"artifacts"
],
"additionalProperties": false,
"definitions": {
"cdap-parameters": {
"description" : "There are three seperate ways to pass parameters to CDAP: app config, app preferences, program preferences. These are all treated as optional.",
"type": "object",
"properties" : {
"program_preferences": {
"description" : "A list of {program_id, program_type, program_preference} objects where program_preference is an object passed into program_id of type program_type",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/program_preference"
}
},
"app_preferences" : {
"description" : "Parameters Passed down to the CDAP preference API",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/parameter"
}
},
"app_config" : {
"description" : "Parameters Passed down to the CDAP App Config",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/parameter"
}
}
}
},
"program_preference": {
"type": "object",
"properties": {
"program_type": {
"$ref": "#/definitions/program_type"
},
"program_id": {
"type": "string"
},
"program_pref":{
"description" : "Parameters that the CDAP developer wants pushed to this program's preferences API. Optional",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/parameter"
}
}
},
"required": ["program_type", "program_id", "program_pref"]
},
"program_type": {
"type": "string",
"enum": ["flows","mapreduce","schedules","spark","workflows","workers","services"]
},
"docker-parameters": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/parameter"
}
},
"parameter": {
"oneOf": [
{"$ref": "#/definitions/parameter-list"},
{"$ref": "#/definitions/parameter-other"}
]
},
"parameter-list": {
"properties": {
"name": {
"type": "string"
},
"value": {
"description": "Default value for the parameter"
},
"description": {
"description": "Description for the parameter.",
"type": "string"
},
"type": {
"description": "Only valid type is list, the entry_schema is required - which contains the type of the list element. All properties set for the parameter apply to all elements in the list at this time",
"type": "string",
"enum": ["list"]
},
"required": {
"description": "An optional key that declares a parameter as required (true) or not (false). Default is true.",
"type": "boolean",
"default": true
},
"constraints": {
"description": "The optional list of sequenced constraint clauses for the parameter.",
"type": "array",
"items": {
"$ref": "#/definitions/parameter-constraints"
}
},
"entry_schema": {
"description": "The optional property used to declare the name of the Datatype definition for entries of certain types. entry_schema must be defined when the type is list. This is the only type it is currently supported for.",
"type": "object",
"uniqueItems": true,
"items": {"$ref": "#/definitions/list-parameter"}
},
"designer_editable": {
"description": "A required property that declares a parameter as editable by designer in SDC Tool (true) or not (false).",
"type": "boolean"
},
"sourced_at_deployment": {
"description": "A required property that declares that a parameter is assigned at deployment time (true) or not (false).",
"type": "boolean"
},
"policy_editable": {
"description": "A required property that declares a parameter as editable by DevOps in Policy UI (true) or not (false).",
"type": "boolean"
},
"policy_group": {
"description": "An optional property used to group policy_editable parameters into groups. Each group will become it's own policy model. Any parameters without this property will be grouped together to form their own policy model",
"type": "string"
},
"policy_schema" :{
"type": "array",
"uniqueItems": true,
"items": {"$ref": "#/definitions/policy_schema_parameter"}
}
},
"required": [
"name",
"value",
"description",
"designer_editable",
"policy_editable",
"sourced_at_deployment",
"entry_schema"
],
"additionalProperties": false,
"dependencies": {
"policy_schema": ["policy_editable"]
}
},
"parameter-other": {
"properties": {
"name": {
"type": "string"
},
"value": {
"description": "Default value for the parameter"
},
"description": {
"description": "Description for the parameter.",
"type": "string"
},
"type": {
"description": "The required data type for the parameter.",
"type": "string",
"enum": [ "string", "number", "boolean", "datetime" ]
},
"required": {
"description": "An optional key that declares a parameter as required (true) or not (false). Default is true.",
"type": "boolean",
"default": true
},
"constraints": {
"description": "The optional list of sequenced constraint clauses for the parameter.",
"type": "array",
"items": {
"$ref": "#/definitions/parameter-constraints"
}
},
"designer_editable": {
"description": "A required property that declares a parameter as editable by designer in SDC Tool (true) or not (false).",
"type": "boolean"
},
"sourced_at_deployment": {
"description": "A required property that declares that a parameter is assigned at deployment time (true) or not (false).",
"type": "boolean"
},
"policy_editable": {
"description": "A required property that declares a parameter as editable in Policy UI (true) or not (false).",
"type": "boolean"
},
"policy_group": {
"description": "An optional property used to group policy_editable parameters into groups. Each group will become it's own policy model. Any parameters without this property will be grouped together to form their own policy model",
"type": "string"
},
"policy_schema" :{
"description": "An optional property used to define policy_editable parameters as lists or maps",
"type": "array",
"uniqueItems": true,
"items": {"$ref": "#/definitions/policy_schema_parameter"}
}
},
"required": [
"name",
"value",
"description",
"designer_editable",
"sourced_at_deployment",
"policy_editable"
],
"additionalProperties": false,
"dependencies": {
"policy_schema": ["policy_editable"]
}
},
"list-parameter": {
"type": "object",
"properties": {
"type": {
"description": "The required data type for each parameter in the list.",
"type": "string",
"enum": ["string", "number"]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"policy_schema_parameter": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"description": "Default value for the parameter"
},
"description": {
"description": "Description for the parameter.",
"type": "string"
},
"type": {
"description": "The required data type for the parameter.",
"type": "string",
"enum": [ "string", "number", "boolean", "datetime", "list", "map" ]
},
"required": {
"description": "An optional key that declares a parameter as required (true) or not (false). Default is true.",
"type": "boolean",
"default": true
},
"constraints": {
"description": "The optional list of sequenced constraint clauses for the parameter.",
"type": "array",
"items": {
"$ref": "#/definitions/parameter-constraints"
}
},
"entry_schema": {
"description": "The optional key that is used to declare the name of the Datatype definition for entries of certain types. entry_schema must be defined when the type is either list or map. If the type is list and the entry type is a simple type (string, number, boolean, datetime), follow with a simple string to describe the entry type. If the type is list and the entry type is a map, follow with an array to describe the keys for the entry map. If the type is list and the entry type is also list, this is not currently supported here. If the type is map, then follow with an array to describe the keys for this map. ",
"type": "array", "uniqueItems": true, "items": {"$ref": "#/definitions/policy_schema_parameter"}
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
},
"parameter-constraints": {
"type": "object",
"additionalProperties": false,
"properties": {
"equal": {
"description": "Constrains a property or parameter to a value equal to (‘=’) the value declared."
},
"greater_than": {
"description": "Constrains a property or parameter to a value greater than (‘>’) the value declared.",
"type": "number"
},
"greater_or_equal": {
"description": "Constrains a property or parameter to a value greater than or equal to (‘>=’) the value declared.",
"type": "number"
},
"less_than": {
"description": "Constrains a property or parameter to a value less than (‘<’) the value declared.",
"type": "number"
},
"less_or_equal": {
"description": "Constrains a property or parameter to a value less than or equal to (‘<=’) the value declared.",
"type": "number"
},
"valid_values": {
"description": "Constrains a property or parameter to a value that is in the list of declared values.",
"type": "array"
},
"length": {
"description": "Constrains the property or parameter to a value of a given length.",
"type": "number"
},
"min_length": {
"description": "Constrains the property or parameter to a value to a minimum length.",
"type": "number"
},
"max_length": {
"description": "Constrains the property or parameter to a value to a maximum length.",
"type": "number"
}
}
},
"stream_message_router": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
},
"config_key": {
"type": "string"
},
"type": {
"description": "Type of stream to be used",
"type": "string",
"enum": [
"message router", "message_router"
]
}
},
"required": [
"format",
"version",
"config_key",
"type"
]
},
"publisher_http": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
},
"config_key": {
"type": "string"
},
"type": {
"description": "Type of stream to be used",
"type": "string",
"enum": [
"http",
"https"
]
}
},
"required": [
"format",
"version",
"config_key",
"type"
]
},
"publisher_message_router": {
"$ref": "#/definitions/stream_message_router"
},
"publisher_data_router": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
},
"config_key": {
"type": "string"
},
"type": {
"description": "Type of stream to be used",
"type": "string",
"enum": [
"data router", "data_router"
]
}
},
"required": [
"format",
"version",
"config_key",
"type"
]
},
"subscriber_http": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
},
"route": {
"type": "string"
},
"type": {
"description": "Type of stream to be used",
"type": "string",
"enum": [
"http",
"https"
]
}
},
"required": [
"format",
"version",
"route",
"type"
]
},
"subscriber_message_router": {
"$ref": "#/definitions/stream_message_router"
},
"subscriber_data_router": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
},
"route": {
"type": "string"
},
"type": {
"description": "Type of stream to be used",
"type": "string",
"enum": [
"data router", "data_router"
]
},
"config_key": {
"description": "Data router subscribers require config info to setup their endpoints to handle requests. For example, needs username and password",
"type": "string"
}
},
"required": [
"format",
"version",
"route",
"type",
"config_key"
]
},
"provider" : {
"oneOf" : [
{"$ref": "#/definitions/docker-provider"},
{"$ref": "#/definitions/cdap-provider"}
]
},
"cdap-provider" : {
"type": "object",
"properties" : {
"request": {
"$ref": "#/definitions/formatPair"
},
"response": {
"$ref": "#/definitions/formatPair"
},
"service_name" : {
"type" : "string"
},
"service_endpoint" : {
"type" : "string"
},
"verb" : {
"type": "string",
"enum": ["GET", "PUT", "POST", "DELETE"]
}
},
"required" : [
"request",
"response",
"service_name",
"service_endpoint",
"verb"
]
},
"docker-provider": {
"type": "object",
"properties": {
"request": {
"$ref": "#/definitions/formatPair"
},
"response": {
"$ref": "#/definitions/formatPair"
},
"route": {
"type": "string"
},
"verb": {
"type": "string",
"enum": ["GET", "PUT", "POST", "DELETE"]
}
},
"required": [
"request",
"response",
"route"
]
},
"caller": {
"type": "object",
"properties": {
"request": {
"$ref": "#/definitions/formatPair"
},
"response": {
"$ref": "#/definitions/formatPair"
},
"config_key": {
"type": "string"
}
},
"required": [
"request",
"response",
"config_key"
]
},
"formatPair": {
"type": "object",
"properties": {
"format": {
"$ref": "#/definitions/name"
},
"version": {
"$ref": "#/definitions/version"
}
}
},
"name": {
"type": "string"
},
"version": {
"type": "string",
"pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
},
"artifact": {
"type": "object",
"description": "Component artifact object",
"properties": {
"uri": {
"type": "string",
"description": "Uri to artifact"
},
"type": {
"type": "string",
"enum": ["jar", "docker image"]
}
},
"required": ["uri", "type"]
},
"auxilary_cdap": {
"title": "cdap component specification schema",
"type": "object",
"properties": {
"streamname": {
"type": "string"
},
"artifact_name" : {
"type": "string"
},
"artifact_version" : {
"type": "string",
"pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
},
"namespace":{
"type": "string",
"description" : "optional"
},
"programs": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/cdap_program"
}
}
},
"required": [
"streamname",
"programs",
"artifact_name",
"artifact_version"
]
},
"cdap_program_type": {
"type": "string",
"enum": ["flows","mapreduce","schedules","spark","workflows","workers","services"]
},
"cdap_program": {
"type": "object",
"properties": {
"program_type": {
"$ref": "#/definitions/cdap_program_type"
},
"program_id": {
"type": "string"
}
},
"required": ["program_type", "program_id"]
},
"auxilary_docker": {
"title": "Docker component specification schema",
"type": "object",
"properties": {
"healthcheck": {
"description": "Define the health check that Consul should perfom for this component",
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/docker_healthcheck_http" },
{ "$ref": "#/definitions/docker_healthcheck_script" }
]
},
"ports": {
"description": "Port mapping to be used for Docker containers. Each entry is of the format <container port>:<host port>.",
"type": "array",
"items": {
"type": "string"
}
},
"log_info": {
"description": "Component specific details for logging",
"type": "object",
"properties": {
"log_directory": {
"description": "The path in the container where the component writes its logs. If the component is following the EELF requirements, this would be the directory where the four EELF files are being written. (Other logs can be placed in the directory--if their names in '.log', they'll also be sent into ELK.)",
"type": "string"
},
"alternate_fb_path": {
"description": "By default, the log volume is mounted at /var/log/onap/<component_type> in the sidecar container's file system. 'alternate_fb_path' allows overriding the default. Will affect how the log data can be found in the ELK system.",
"type": "string"
}
},
"additionalProperties": false
},
"tls_info": {
"description": "Component information to use tls certificates",
"type": "object",
"properties": {
"cert_directory": {
"description": "The path in the container where the component certificates will be placed by the init container",
"type": "string"
},
"use_tls": {
"description": "Boolean flag to determine if the application is using tls certificates",
"type": "boolean"
}
},
"required": [
"cert_directory","use_tls"
],
"additionalProperties": false
},
"databases": {
"description": "The databases the application is connecting to using the pgaas",
"type": "object",
"additionalProperties": {
"type": "string",
"enum": [
"postgres"
]
}
},
"policy": {
"properties": {
"trigger_type": {
"description": "Only value of docker is supported at this time.",
"type": "string",
"enum": ["docker"]
},
"script_path": {
"description": "Script command that will be executed for policy reconfiguration",
"type": "string"
}
},
"required": [
"trigger_type","script_path"
],
"additionalProperties": false
},
"volumes": {
"description": "Volume mapping to be used for Docker containers. Each entry is of the format below",
"type": "array",
"items": {
"type": "object",
"properties": {
"host":{
"type":"object",
"path": {"type": "string"}
},
"container":{
"type":"object",
"bind": { "type": "string"},
"mode": { "type": "string"}
}
}
}
}
},
"required": [
"healthcheck"
],
"additionalProperties": false
},
"docker_healthcheck_http": {
"properties": {
"type": {
"description": "Consul health check type",
"type": "string",
"enum": [
"http",
"https"
]
},
"interval": {
"description": "Interval duration in seconds i.e. 10s",
"default": "15s",
"type": "string"
},
"timeout": {
"description": "Timeout in seconds i.e. 10s",
"default": "1s",
"type": "string"
},
"endpoint": {
"description": "Relative endpoint used by Consul to check health by making periodic HTTP GET calls",
"type": "string"
}
},
"required": [
"type",
"endpoint"
]
},
"docker_healthcheck_script": {
"properties": {
"type": {
"description": "Consul health check type",
"type": "string",
"enum": [
"script",
"docker"
]
},
"interval": {
"description": "Interval duration in seconds i.e. 10s",
"default": "15s",
"type": "string"
},
"timeout": {
"description": "Timeout in seconds i.e. 10s",
"default": "1s",
"type": "string"
},
"script": {
"description": "Script command that will be executed by Consul to check health",
"type": "string"
}
},
"required": [
"type",
"script"
]
}
}
}
|